From 513781ff58499633c132b51b2608f600936ee699 Mon Sep 17 00:00:00 2001 From: Luca Carrogu Date: Thu, 23 Nov 2023 15:02:27 +0100 Subject: [PATCH] Add checksum check on Munge download Add checksum check on Munge download Signed-off-by: Luca Carrogu --- cookbooks/aws-parallelcluster-slurm/attributes/versions.rb | 2 ++ .../resources/munge/partial/_munge_actions.rb | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cookbooks/aws-parallelcluster-slurm/attributes/versions.rb b/cookbooks/aws-parallelcluster-slurm/attributes/versions.rb index 24d596a93..ec1934ec2 100644 --- a/cookbooks/aws-parallelcluster-slurm/attributes/versions.rb +++ b/cookbooks/aws-parallelcluster-slurm/attributes/versions.rb @@ -6,3 +6,5 @@ default['cluster']['slurm']['base_url'] = "https://github.com/SchedMD/slurm/archive" # Munge default['cluster']['munge']['munge_version'] = '0.5.15' +default['cluster']['munge']['sha256'] = '51b2c81d1a7ec2ab5d486fa51b50c7e79eb1810ca6687b6ed65f3601abc55614' +default['cluster']['munge']['base_url'] = "https://github.com/dun/munge/archive" diff --git a/cookbooks/aws-parallelcluster-slurm/resources/munge/partial/_munge_actions.rb b/cookbooks/aws-parallelcluster-slurm/resources/munge/partial/_munge_actions.rb index 74b869a61..4f98bb63d 100644 --- a/cookbooks/aws-parallelcluster-slurm/resources/munge/partial/_munge_actions.rb +++ b/cookbooks/aws-parallelcluster-slurm/resources/munge/partial/_munge_actions.rb @@ -20,12 +20,13 @@ default_action :setup munge_version = node['cluster']['munge']['munge_version'] -munge_url = "https://github.com/dun/munge/archive/munge-#{munge_version}.tar.gz" +munge_url = "#{node['cluster']['munge']['base_url']}/munge-#{munge_version}.tar.gz" munge_tarball = "#{node['cluster']['sources_dir']}/munge-#{munge_version}.tar.gz" munge_user = node['cluster']['munge']['user'] munge_user_id = node['cluster']['munge']['user_id'] munge_group = node['cluster']['munge']['group'] munge_group_id = node['cluster']['munge']['group_id'] +munge_sha256 = node['cluster']['munge']['sha256'] action :setup do directory node['cluster']['sources_dir'] do @@ -67,7 +68,7 @@ mode '0644' retries 3 retry_delay 5 - # TODO: Add version or checksum checks + checksum munge_sha256 action :create_if_missing end end