Avoid apt race condition

This race can arise when cloud-init is still running when the join runs.

Change-Id: I01b22132081e20050dc7b74556f74f82576e8c1e
This commit is contained in:
Mark Burnett 2017-11-17 13:27:26 -06:00
parent 3b3f2baf4b
commit 8bb62520a3
1 changed files with 2 additions and 2 deletions

View File

@ -48,7 +48,6 @@ log
log === Installing system packages ===
set -x
export DEBIAN_FRONTEND=noninteractive
end=$(($(date +%s) + 600))
while true; do
if ! apt-get update; then
@ -65,7 +64,7 @@ done
end=$(($(date +%s) + 600))
while true; do
if ! apt-get install -y --no-install-recommends \
if ! DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
{%- for package in config['HostSystem:packages.additional'] | default([]) %}
{{ package }} \
{%- endfor %}
@ -76,6 +75,7 @@ while true; do
log Failed to install apt packages.
exit 1
fi
sleep 10
else
break
fi