Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Install awscli without python/pip #280

Merged
merged 2 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/terraform/gce/bootstrap/centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ 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
rm -rf awscliv2.zip ./aws
fi

if ! grep -qs "$etcd_dir" /proc/mounts; then
Expand Down
22 changes: 6 additions & 16 deletions assets/terraform/gce/bootstrap/sles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,13 @@ 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
rm -rf awscliv2.zip ./aws
fi

install-aws-cli

mkdir -p /var/lib/gravity/planet/etcd /var/lib/data

Expand Down
13 changes: 9 additions & 4 deletions assets/terraform/gce/bootstrap/ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,15 @@ 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

curl https://bootstrap.pypa.io/get-pip.py | python -
pip install --upgrade awscli
apt-get install -y chrony lvm2 curl wget thin-provisioning-tools

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
rm -rf awscliv2.zip ./aws
fi

if ! grep -qs "$etcd_dir" /proc/mounts; then
mkfs.ext4 -F /dev/$etcd_device_name
Expand Down