@@ -35,7 +35,7 @@ if [[ "${OS}" == "amzn2023" ]]; then
3535 cat > ${REPOSITORY_DEFINITION_FILE} << REPO_DEFINITION
3636[amzn2023-iso]
3737name=Amazon Linux 2023 isolated Region repository
38- mirrorlist=http://al2023-repos-$awsregion -de612dc2.s3.$awsregion .$awsdomain /core-iso/mirrors/$releasever /$basearch /mirror.list
38+ mirrorlist=http://al2023-repos-\ $ awsregion-de612dc2.s3.\ $ awsregion.\ $ awsdomain/core-iso/mirrors/\ $ releasever/\ $ basearch/mirror.list
3939priority=10
4040enabled=1
4141repo_gpgcheck=0
@@ -45,8 +45,12 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-linux-2023
4545REPO_DEFINITION
4646
4747 echo " sslverify=0" >> /etc/dnf/dnf.conf
48- dnf install -y amazon-linux-repo-iso ca-certificates-iso
49- echo -n " " > sudo tee /etc/dnf/vars/dualstack
48+ echo -n " " | sudo tee /etc/dnf/vars/dualstack
49+ if [[ ${REGION} == us-isob* ]]; then
50+ dnf install -y amazon-linux-repo-iso ca-certificates-isob
51+ else
52+ dnf install -y amazon-linux-repo-iso ca-certificates-iso
53+ fi
5054 sed -i " s/sslverify=0//g" /etc/dnf/dnf.conf
5155else
5256 cat > ${REPOSITORY_DEFINITION_FILE} << REPO_DEFINITION
6670
6771rm -f ${REPOSITORY_DEFINITION_FILE}
6872
69- echo " [INFO] Complete: installation of packages from amazon Linux 2 repository for US isolated region"
73+ echo " [INFO] Complete: installation of packages from ${OS} repository for US isolated region"
7074
7175echo " [INFO] Starting: CA bundle configuration for AWS CLI in US isolated region"
7276
73- USERS=(< %= @users %> )
7477CA_BUNDLE=" /etc/pki/${REGION} /certs/ca-bundle.pem"
7578
76- for user in " ${USERS[@]} " ; do
77- echo " [INFO] Setting CA bundle ${CA_BUNDLE} for user ${user} "
78- sudo mkhomedir_helper $user
79- sudo -u $user aws configure set ca_bundle " $CA_BUNDLE "
80- done
79+ sudo aws configure set ca_bundle " $CA_BUNDLE "
8180
8281echo " [INFO] Complete: CA bundle configuration for AWS CLI in US isolated region"
8382
8483echo " [INFO] Starting: Setting system-wide environment variables for AWS CLI in US isolated region"
8584
85+ echo " export AWS_CA_BUNDLE=/etc/pki/${REGION} /certs/ca-bundle.pem" >> /etc/profile.d/aws-cli-default-config.sh
86+
8687echo " export AWS_DEFAULT_REGION=${REGION} " >> /etc/profile.d/aws-cli-default-config.sh
8788
88- echo " Defaults env_keep += \" AWS_DEFAULT_REGION AWS_CA_BUNDLE\" " > /etc/sudoers .d/pcluster- aws-cli-envkeep
89+ echo " export REQUESTS_CA_BUNDLE= ${ AWS_CA_BUNDLE} " >> /etc/profile .d/aws-cli-default-config.sh
8990
90- echo " [INFO] Complete: Setting system-wide environment variables for AWS CLI in US isolated region"
91+ echo " export SSL_CERT_FILE=${AWS_CA_BUNDLE} " >> /etc/profile.d/aws-cli-default-config.sh
92+
93+ echo " Defaults env_keep += \" AWS_DEFAULT_REGION AWS_CA_BUNDLE REQUESTS_CA_BUNDLE SSL_CERT_FILE\" " > /etc/sudoers.d/pcluster-aws-cli-envkeep
9194
92- echo " [INFO] Complete: instance configuration for US isolated region"
95+ source /etc/profile.d/aws-cli-default-config.sh
96+
97+ sudo aws configure set ca_bundle " $CA_BUNDLE "
98+
99+ echo " [INFO] Complete: Setting system-wide environment variables for AWS CLI in US isolated region"
0 commit comments