Refactor vm readiness logic.
This commit is contained in:
parent
f615e14988
commit
6e2514b12f
@ -139,11 +139,6 @@ fi
|
|||||||
# wait for the vm to have an IP address
|
# wait for the vm to have an IP address
|
||||||
. ./management/wait_for_lxc_ip.sh
|
. ./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
|
# do some other preparations for user experience
|
||||||
lxc file push ./management/bash_aliases ss-mgmt/home/ubuntu/.bash_aliases
|
lxc file push ./management/bash_aliases ss-mgmt/home/ubuntu/.bash_aliases
|
||||||
lxc file push ./management/bash_profile ss-mgmt/home/ubuntu/.bash_profile
|
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
|
ADDED_COMMAND=true
|
||||||
fi
|
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.
|
# 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
|
# we are using IP address here so we don't have to rely on external DNS
|
||||||
# configuration for the base image preparataion.
|
# configuration for the base image preparataion.
|
||||||
|
@ -35,7 +35,5 @@ fi
|
|||||||
|
|
||||||
. ./management/wait_for_lxc_ip.sh
|
. ./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.
|
# let's ensure ~/.ssh/ssh_config is using the correct IP address for ss-mgmt.
|
||||||
ssh ubuntu@"$IP_V4_ADDRESS"
|
ssh ubuntu@"$IP_V4_ADDRESS"
|
||||||
|
@ -25,3 +25,8 @@ done
|
|||||||
|
|
||||||
|
|
||||||
export IP_V4_ADDRESS="$IP_V4_ADDRESS"
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user