diff --git a/assets/terraform/gce/bootstrap/sles.sh b/assets/terraform/gce/bootstrap/sles.sh index 6f175d8c..22ee1be5 100644 --- a/assets/terraform/gce/bootstrap/sles.sh +++ b/assets/terraform/gce/bootstrap/sles.sh @@ -81,23 +81,12 @@ mkdir -p $etcd_dir /var/lib/data secure-ssh setup-user -function install-aws-cli { - # suse-cloud/sles-15-sp1-v20200415 has no python, but offers python3. - # suse-cloud/sles-12-sp5-v20200227 has both, but it's python3 < 3.5 and is - # incompatible with awscli. - if command -v python; then - local python=$(command -v python) - elif command -v python3; then - local python=$(command -v python3) - else - echo "No python available." - exit 2 - fi - curl https://bootstrap.pypa.io/get-pip.py | $python - - $python -m pip install --upgrade awscli -} +if ! /usr/local/bin/aws --version; then + curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.0.30.zip" -o "awscliv2.zip" + unzip awscliv2.zip + ./aws/install +fi -install-aws-cli mkdir -p /var/lib/gravity/planet/etcd /var/lib/data diff --git a/assets/terraform/gce/bootstrap/ubuntu.sh b/assets/terraform/gce/bootstrap/ubuntu.sh index 7278fd00..b99b8de1 100644 --- a/assets/terraform/gce/bootstrap/ubuntu.sh +++ b/assets/terraform/gce/bootstrap/ubuntu.sh @@ -94,10 +94,14 @@ setup-user echo "APT::Acquire::Retries \"10\";" > /etc/apt/apt.conf.d/80-retries apt-get update -apt-get install -y chrony lvm2 curl wget thin-provisioning-tools python +apt-get install -y chrony lvm2 curl wget thin-provisioning-tools -curl https://bootstrap.pypa.io/get-pip.py | python - -pip install --upgrade awscli +if ! /usr/local/bin/aws --version; then + apt-get install -y unzip + curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.0.30.zip" -o "awscliv2.zip" + unzip awscliv2.zip + ./aws/install +fi if ! grep -qs "$etcd_dir" /proc/mounts; then mkfs.ext4 -F /dev/$etcd_device_name