File tree 2 files changed +7
-5
lines changed
cli/src/pcluster/resources/imagebuilder
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -198,9 +198,10 @@ phases:
198
198
grub2-mkconfig -o /boot/grub2/grub.cfg
199
199
fi
200
200
elif [[ ${!PLATFORM} == DEBIAN ]]; then
201
- [ ${CfnParamUpdateOsAndReboot} == false ] && flock $(apt-config shell StateDir Dir::State/d | sed -r "s/.*'(.*)\/?'$/\1/")/daily_lock systemctl stop apt-daily.timer apt-daily.service apt-daily-upgrade.timer apt-daily-upgrade.service
202
- sed -i "s/Update-Package-Lists \"1\"/Update-Package-Lists \"0\"/g" /etc/apt/apt.conf.d/20auto-upgrades
203
- sed -i "s/Unattended-Upgrade \"1\"/Unattended-Upgrade \"0\"/g" /etc/apt/apt.conf.d/20auto-upgrades
201
+ if [[ "${CfnParamUpdateOsAndReboot}" == "false" ]]; then
202
+ flock $(apt-config shell StateDir Dir::State/d | sed -r "s/.*'(.*)\/?'$/\1/")/daily_lock systemctl disable --now apt-daily.timer apt-daily.service apt-daily-upgrade.timer apt-daily-upgrade.service
203
+ sed "/Update-Package-Lists/s/\"1\"/\"0\"/; /Unattended-Upgrade/s/\"1\"/\"0\"/;" /etc/apt/apt.conf.d/20auto-upgrades > "/etc/apt/apt.conf.d/51pcluster-unattended-upgrades"
204
+ fi
204
205
apt-cache search build-essential
205
206
apt-get clean
206
207
apt-get -y update
Original file line number Diff line number Diff line change @@ -117,7 +117,8 @@ phases:
117
117
yum -y install kernel-devel
118
118
elif [[ ${!PLATFORM} == DEBIAN ]]; then
119
119
while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done
120
- flock $(apt-config shell StateDir Dir::State/d | sed -r "s/.*'(.*)\/?'$/\1/")/daily_lock systemctl stop apt-daily.timer apt-daily.service apt-daily-upgrade.timer apt-daily-upgrade.service
120
+ flock $(apt-config shell StateDir Dir::State/d | sed -r "s/.*'(.*)\/?'$/\1/")/daily_lock systemctl disable --now apt-daily.timer apt-daily.service apt-daily-upgrade.timer apt-daily-upgrade.service
121
+ sed "/Update-Package-Lists/s/\"1\"/\"0\"/; /Unattended-Upgrade/s/\"1\"/\"0\"/;" /etc/apt/apt.conf.d/20auto-upgrades > "/etc/apt/apt.conf.d/51pcluster-unattended-upgrades"
121
122
DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --with-new-pkgs upgrade && apt-get --purge autoremove -y
122
123
apt-get -y install linux-aws
123
124
fi
@@ -149,4 +150,4 @@ phases:
149
150
inputs :
150
151
commands :
151
152
- |
152
- echo "Check the OS has been updated"
153
+ echo "Check the OS has been updated"
You can’t perform that action at this time.
0 commit comments