Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit d4b7650

Browse files
authored
fix(examples): Upgrading ubuntu example to 22.04 (#2250)
* fix(examples): adding iptables to ubuntu example * fix(examples): adding export to .profile * chore: bump ubuntu example to latest LTS, 22.04 #2103
1 parent 9f7d32d commit d4b7650

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Diff for: examples/ubuntu/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module "runners" {
4646
ami_owners = ["099720109477"] # Canonical's Amazon account ID
4747

4848
ami_filter = {
49-
name = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"]
49+
name = ["ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*"]
5050
}
5151

5252
# Custom build AMI, no custom userdata needed.

Diff for: examples/ubuntu/templates/user-data.sh

+8-7
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ ${pre_install}
77
apt-get update
88
DEBIAN_FRONTEND=noninteractive apt-get install -y \
99
awscli \
10-
jq \
10+
build-essential \
1111
curl \
12-
wget \
1312
git \
13+
iptables \
14+
jq \
1415
uidmap \
15-
build-essential \
16-
unzip
16+
unzip \
17+
wget
1718

1819
user_name=ubuntu
1920
user_id=$(id -ru $user_name)
@@ -43,16 +44,16 @@ WantedBy=default.target
4344
4445
EOF
4546

46-
echo export XDG_RUNTIME_DIR=/run/user/$user_id >>/home/$user_name/.profile
47+
echo export XDG_RUNTIME_DIR=/run/user/$user_id >>/home/$user_name/.bashrc
4748

4849
systemctl daemon-reload
4950
systemctl enable [email protected]
5051
systemctl start [email protected]
5152

5253
curl -fsSL https://get.docker.com/rootless >>/opt/rootless.sh && chmod 755 /opt/rootless.sh
5354
su -l $user_name -c /opt/rootless.sh
54-
echo export DOCKER_HOST=unix:///run/user/$user_id/docker.sock >>/home/$user_name/.profile
55-
echo export PATH=/home/$user_name/bin:$PATH >>/home/$user_name/.profile
55+
echo export DOCKER_HOST=unix:///run/user/$user_id/docker.sock >>/home/$user_name/.bashrc
56+
echo export PATH=/home/$user_name/bin:$PATH >>/home/$user_name/.bashrc
5657

5758
# Run docker service by default
5859
loginctl enable-linger $user_name

0 commit comments

Comments
 (0)