Skip to content

Commit

Permalink
patch iso
Browse files Browse the repository at this point in the history
  • Loading branch information
hgreebe committed Jul 24, 2024
1 parent ba27cb5 commit 2dd50de
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -ex

function get_instance_region {
local _token=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 3600")
curl -H "X-aws-ec2-metadata-token: $_token" -v "http://169.254.169.254/latest/meta-data/placement/region" 2> /dev/null
}

REGION="$(get_instance_region)"

echo -e "export AWS_CA_BUNDLE=/etc/pki/${REGION}/certs/ca-bundle.pem" >> /etc/profile.d/aws-cli-default-config.sh

echo "export AWS_DEFAULT_REGION=${REGION}" >> /etc/profile.d/aws-cli-default-config.sh

echo "Defaults env_keep += \"AWS_DEFAULT_REGION AWS_CA_BUNDLE\"" > /etc/sudoers.d/pcluster-aws-cli-envkeep
24 changes: 12 additions & 12 deletions cookbooks/aws-parallelcluster-platform/recipes/install/awscli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
code "#{file_cache_path}/awscli/aws/install -i /usr/local/aws -b /usr/local/bin"
end

# cookbook_file "#{node['cluster']['scripts_dir']}/iso-ca-bundle-config.sh" do
# source 'isolated/iso-ca-bundle-config.sh'
# cookbook 'aws-parallelcluster-platform'
# owner 'root'
# group 'root'
# mode '0755'
# action :create_if_missing
# end
#
# execute "patch ca bundle" do
# command "sh #{node['cluster']['scripts_dir']}/iso-ca-bundle-config.sh"
# end
cookbook_file "#{node['cluster']['scripts_dir']}/iso-ca-bundle-config.sh" do
source 'isolated/iso-ca-bundle-config.sh'
cookbook 'aws-parallelcluster-platform'
owner 'root'
group 'root'
mode '0755'
action :create_if_missing
end

execute "patch ca bundle" do
command "sh #{node['cluster']['scripts_dir']}/iso-ca-bundle-config.sh"
end
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def default_packages

action :install_extras do
remote_file "epel_deps.tar.gz" do
source "https://dut1b9icvluta.cloudfront.net/archives/dependencies/epel/rhel8/x86_64/epel_deps.tar.gz"
source "#{node['cluster']['artifacts_s3_url']}/dependencies/epel/rhel8/x86_64/epel_deps.tar.gz"
mode '0644'
retries 3
retry_delay 5
Expand Down

0 comments on commit 2dd50de

Please sign in to comment.