Improve control flow
This commit is contained in:
parent
e8499ab6f7
commit
dcf9e37407
@ -16,7 +16,7 @@ if ! lxc image list --format csv --columns l | grep -q "$UBUNTU_BASE_IMAGE_NAME"
|
|||||||
--alias "$UBUNTU_BASE_IMAGE_NAME"
|
--alias "$UBUNTU_BASE_IMAGE_NAME"
|
||||||
else
|
else
|
||||||
# copy the image down from canonical.
|
# copy the image down from canonical.
|
||||||
lxc image copy "images:$BASE_LXC_IMAGE" "$REMOTE_NAME": --alias "$UBUNTU_BASE_IMAGE_NAME" --public --vm --auto-update
|
lxc image copy "images:$BASE_LXC_IMAGE" "$REMOTE_NAME": --alias "$UBUNTU_BASE_IMAGE_NAME" --public --vm --auto-update
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -382,7 +382,6 @@ EOL
|
|||||||
# check if the OVN network exists in this project.
|
# check if the OVN network exists in this project.
|
||||||
if ! lxc network list | grep -q "ss-ovn"; then
|
if ! lxc network list | grep -q "ss-ovn"; then
|
||||||
lxc network create ss-ovn --type=ovn network=lxdbr1 ipv6.address=none
|
lxc network create ss-ovn --type=ovn network=lxdbr1 ipv6.address=none
|
||||||
# ipv4.nat=false
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export MAC_ADDRESS_TO_PROVISION=
|
export MAC_ADDRESS_TO_PROVISION=
|
||||||
|
@ -42,6 +42,7 @@ if ! lxc list --format csv | grep -q "$LXD_VM_NAME"; then
|
|||||||
lxc config device override "$LXD_VM_NAME" root size="${ROOT_DISK_SIZE_GB}GB"
|
lxc config device override "$LXD_VM_NAME" root size="${ROOT_DISK_SIZE_GB}GB"
|
||||||
|
|
||||||
lxc start "$LXD_VM_NAME"
|
lxc start "$LXD_VM_NAME"
|
||||||
|
sleep 10
|
||||||
|
|
||||||
bash -c "./wait_for_lxc_ip.sh --lxd-name=$LXD_VM_NAME"
|
bash -c "./wait_for_lxc_ip.sh --lxd-name=$LXD_VM_NAME"
|
||||||
fi
|
fi
|
||||||
|
@ -42,3 +42,8 @@ while true; do
|
|||||||
printf '.'
|
printf '.'
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# wait for cloud-init to complet before returning.
|
||||||
|
while lxc exec "$LXC_INSTANCE_NAME" -- [ ! -f /var/lib/cloud/instance/boot-finished ]; do
|
||||||
|
sleep 1
|
||||||
|
done
|
Loading…
Reference in New Issue
Block a user