1
1
Fork 1

Refactor vm readiness logic.

This commit is contained in:
Derek Smith 2023-04-12 10:03:46 -04:00
parent f615e14988
commit 6e2514b12f
Signed by: farscapian
GPG Key ID: B443E530A14E1C90
3 changed files with 5 additions and 9 deletions

View File

@ -139,11 +139,6 @@ fi
# wait for the vm to have an IP address
. ./management/wait_for_lxc_ip.sh
# wait for the VM to complete its default cloud-init.
while lxc exec ss-mgmt -- [ ! -f /var/lib/cloud/instance/boot-finished ]; do
sleep 1
done
# do some other preparations for user experience
lxc file push ./management/bash_aliases ss-mgmt/home/ubuntu/.bash_aliases
lxc file push ./management/bash_profile ss-mgmt/home/ubuntu/.bash_profile
@ -163,8 +158,6 @@ if ! < "$HOME/.bashrc" grep -q "ss-manage"; then
ADDED_COMMAND=true
fi
wait-for-it -t 300 "$IP_V4_ADDRESS:22" > /dev/null 2>&1
# Let's remove any entry in our known_hosts, then add it back.
# we are using IP address here so we don't have to rely on external DNS
# configuration for the base image preparataion.

View File

@ -35,7 +35,5 @@ fi
. ./management/wait_for_lxc_ip.sh
wait-for-it -t 300 "$IP_V4_ADDRESS:22" > /dev/null 2>&1
# let's ensure ~/.ssh/ssh_config is using the correct IP address for ss-mgmt.
ssh ubuntu@"$IP_V4_ADDRESS"

View File

@ -25,3 +25,8 @@ done
export IP_V4_ADDRESS="$IP_V4_ADDRESS"
# wait for the VM to complete its default cloud-init.
while lxc exec ss-mgmt -- [ ! -f /var/lib/cloud/instance/boot-finished ]; do
sleep 1
done