From 8f19a5e221cc299f772b6d2b8e25a9f9e89d5024 Mon Sep 17 00:00:00 2001 From: Brian Hayden <5826711+bhayden53@users.noreply.github.com> Date: Mon, 13 Sep 2021 15:08:42 +0000 Subject: [PATCH] fix pip cert issue and rotate ami rotation launch template as well --- ami_rotation/ami_rotation_userdata.sh | 7 ++++--- terraform/deploy_ami_rotate.sh | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ami_rotation/ami_rotation_userdata.sh b/ami_rotation/ami_rotation_userdata.sh index e07226cb..2573eaa8 100755 --- a/ami_rotation/ami_rotation_userdata.sh +++ b/ami_rotation/ami_rotation_userdata.sh @@ -94,17 +94,17 @@ mkdir /home/ec2-user/.aws yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo yum install terraform-0.15.4-1 -y -q yum install git -y -q -yum install python3 -y -q - chown -R ec2-user:ec2-user /home/ec2-user/ +echo "export REQUESTS_CA_BUNDLE=/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" >> /home/ec2-user/.bashrc +echo "export CURL_CA_BUNDLE=/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" >> /home/ec2-user/.bashrc mkdir -p /usr/lib/ssl mkdir -p /etc/ssl/certs mkdir -p /etc/pki/ca-trust/extracted/pem ln -s /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /etc/ssl/certs/ca-certificates.crt ln -s /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /usr/lib/ssl/cert.pem -python3 -m pip install -q --upgrade pip && python3 -m pip install boto3 -q +yum install python3 -y -q sudo -i -u ec2-user bash << EOF mkdir ~/bin ~/tmp @@ -116,6 +116,7 @@ nvm install node npm config set registry http://registry.npmjs.org/ npm install -g awsudo npm config set cafile /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem +python3 -m pip install -q --upgrade pip && python3 -m pip install boto3 -q cd ~ rm -rf ~/tmp EOF diff --git a/terraform/deploy_ami_rotate.sh b/terraform/deploy_ami_rotate.sh index c10955a6..3320ef1f 100755 --- a/terraform/deploy_ami_rotate.sh +++ b/terraform/deploy_ami_rotate.sh @@ -112,6 +112,7 @@ awsudo $ADMIN_ARN terraform plan -no-color -var "environment=${aws_env}" -out am -target aws_batch_job_queue.batch_queue \ -target aws_batch_job_queue.model_queue \ -target aws_launch_template.hstdp \ + -target aws_launch_template.ami_rotation \ -var "awsysver=${CALCLOUD_VER}" -var "awsdpver=${CALDP_VER}" -var "csys_ver=${CSYS_VER}" -var "environment=${aws_env}" -var "ci_ami=${ci_ami}" -var "ecs_ami=${ecs_ami}" awsudo $ADMIN_ARN terraform apply -no-color "ami_rotate.out"