Skip to content

Commit e83d293

Browse files
authored
Improve install speed
1 parent 99f5616 commit e83d293

File tree

1 file changed

+41
-4
lines changed

1 file changed

+41
-4
lines changed

UbuntuLinux-LAMP-server.yaml

+41-4
Original file line numberDiff line numberDiff line change
@@ -1401,6 +1401,16 @@ Resources:
14011401
mode: "000644"
14021402
owner: "root"
14031403
group: "root"
1404+
"/etc/systemd/system/systemd-networkd-wait-online.service.d/override.conf":
1405+
content: |
1406+
1407+
[Service]
1408+
ExecStart=
1409+
ExecStart=/usr/lib/systemd/systemd-networkd-wait-online --timeout=3
1410+
1411+
mode: "000644"
1412+
owner: "root"
1413+
group: "root"
14041414
"/root/install-sw.sh":
14051415
content: !Sub |
14061416
#!/bin/bash
@@ -1469,11 +1479,18 @@ Resources:
14691479
echo "export AWS_CLI_AUTO_PROMPT=on-partial" >> /home/ubuntu/.bashrc
14701480
14711481
# Certbot: https://eff-certbot.readthedocs.io/en/stable/install.html#snap-recommended
1472-
snap install --classic certbot
1482+
sudo snap install certbot --classic
14731483
ln -s /snap/bin/certbot /usr/bin/certbot
1484+
sudo snap set certbot trust-plugin-with-root=ok
1485+
sudo snap install certbot-dns-route53
14741486
1475-
snap set certbot trust-plugin-with-root=ok
1476-
snap install certbot-dns-route53
1487+
# Ubuntu 24.04: reduce systemd-networkd-wait-online.service 2+ min timeout
1488+
if (lsb_release -r -s | grep -q 24); then
1489+
sed -i "s/systemd-networkd-wait-online$/& --timeout=3/g" /usr/lib/systemd/system/systemd-networkd-wait-online.service
1490+
else
1491+
rm -f /etc/systemd/system/systemd-networkd-wait-online.service.d/override.conf
1492+
fi
1493+
systemctl daemon-reload
14771494
14781495
rm -f ${!0}
14791496
mode: "000740"
@@ -1545,6 +1562,12 @@ Resources:
15451562
sed -i "s/Prompt=lts/Prompt=never/g" /etc/update-manager/release-upgrades
15461563
chown -R ubuntu:ubuntu /home/ubuntu/.config
15471564
1565+
# Ubuntu 24.04: reduce systemd-networkd-wait-online.service 2+ min timeout
1566+
if (lsb_release -r -s | grep -q 24); then
1567+
sed -i "s/systemd-networkd-wait-online$/& --timeout=3/g" /usr/lib/systemd/system/systemd-networkd-wait-online.service
1568+
fi
1569+
systemctl daemon-reload
1570+
15481571
rm -f ${!0}
15491572
mode: "000740"
15501573
owner: "root"
@@ -1557,12 +1580,26 @@ Resources:
15571580
mode: "000644"
15581581
owner: "ubuntu"
15591582
group: "ubuntu"
1583+
"/etc/skel/.gnomerc":
1584+
content: |
1585+
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
1586+
export GNOME_SHELL_SESSION_MODE=ubuntu
1587+
export XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share:/usr/share:/var/lib/snapd/desktop
1588+
mode: "000644"
1589+
owner: "root"
1590+
group: "root"
15601591
"/home/ubuntu/.config/gnome-initial-setup-done":
15611592
content: |
15621593
yes
15631594
mode: "000664"
15641595
owner: "ubuntu"
15651596
group: "ubuntu"
1597+
"/etc/skel/.config/gnome-initial-setup-done":
1598+
content: |
1599+
yes
1600+
mode: "000644"
1601+
owner: "root"
1602+
group: "root"
15661603
commands:
15671604
install:
15681605
command: "/root/install-dcv.sh > /var/log/install-dcv.log 2>&1"
@@ -2167,7 +2204,7 @@ Outputs:
21672204

21682205
EC2serialConsole:
21692206
Description: EC2 Serial Console
2170-
Value: !Sub "https://${AWS::Region}.console.aws.amazon.com/ec2-instance-connect/ssh?&connType=serial&instanceId=${ec2Instance}&serialPort=0#/"
2207+
Value: !Sub "https://${AWS::Region}.console.aws.amazon.com/ec2-instance-connect/ssh?connType=serial&instanceId=${ec2Instance}&serialPort=0#/"
21712208

21722209
EC2iamRole:
21732210
Description: EC2 IAM role

0 commit comments

Comments
 (0)