Kelley Spoon | c2f86f5 | 2022-11-17 07:28:36 -0600 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | set -eu |
| 4 | apt-get -qq update |
| 5 | DEBIAN_FRONTEND=noninteractive apt-get install -qy \ |
| 6 | apt-transport-https \ |
| 7 | ca-certificates \ |
| 8 | curl \ |
| 9 | gnupg \ |
| 10 | gnupg-agent \ |
| 11 | openjdk-11-jdk-headless \ |
| 12 | python3 \ |
| 13 | python3-venv \ |
| 14 | software-properties-common \ |
| 15 | unzip |
| 16 | |
| 17 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - |
| 18 | add-apt-repository \ |
| 19 | "deb https://download.docker.com/linux/ubuntu \ |
| 20 | $(lsb_release -cs) \ |
| 21 | stable" |
| 22 | |
| 23 | apt-get -qq update |
| 24 | DEBIAN_FRONTEND=noninteractive apt-get install -qy --no-install-recommends \ |
| 25 | docker-ce \ |
| 26 | docker-ce-cli |
| 27 | |
| 28 | update-alternatives --install /usr/bin/python python /usr/bin/python3 1 |
| 29 | |
| 30 | if [ $(uname -m) = "aarch64" ] |
| 31 | then |
| 32 | AWS_ZIP=https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip |
| 33 | else |
| 34 | AWS_ZIP=https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip |
| 35 | fi |
| 36 | |
| 37 | curl "$AWS_ZIP" -o "/tmp/awscli-bundle.zip" |
| 38 | unzip -q -d /tmp/awscli /tmp/awscli-bundle.zip |
| 39 | /tmp/awscli/aws/install -i /usr/local/aws |
| 40 | aws --version |
| 41 | |
| 42 | adduser ubuntu docker |
| 43 | |
| 44 | mkdir /home/ubuntu/.aws |
| 45 | echo '[default]' >> /home/ubuntu/.aws/config |
| 46 | echo 'region = us-east-1' >> /home/ubuntu/.aws/config |
| 47 | |
| 48 | # Disable unattended-upgrade |
| 49 | systemctl disable unattended-upgrades.service |
| 50 | apt-get -y remove unattended-upgrades |
| 51 | |
| 52 | sed -i -e 's/#PermitTTY.*/PermitTTY yes/g' /etc/ssh/sshd_config |
| 53 | |
Saheer Babu | 5013e9d | 2025-02-05 12:04:59 +0000 | [diff] [blame] | 54 | curl --output packer.zip https://releases.hashicorp.com/packer/1.11.2/packer_1.11.2_linux_amd64.zip |
Kelley Spoon | 1d2e6f3 | 2022-12-16 22:51:45 -0600 | [diff] [blame] | 55 | unzip -o packer.zip |
| 56 | install -m 755 packer /usr/bin/packer |
Saheer Babu | 5013e9d | 2025-02-05 12:04:59 +0000 | [diff] [blame] | 57 | packer plugins install github.com/hashicorp/amazon 1.3.3 |