Skip to content

Commit 207dbb8

Browse files
committed
Add cloud-init package
This pr installs cloud-init package and enable the cloud-init related services. This also clean the logs and config just before shutdown so that it can run with first boot.
1 parent 8fbadcd commit 207dbb8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

createdisk.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ INSTALL_DIR=${1:-crc-tmp-install-data}
1616
OPENSHIFT_VERSION=$(${JQ} -r .clusterInfo.openshiftVersion $INSTALL_DIR/crc-bundle-info.json)
1717
BASE_DOMAIN=$(${JQ} -r .clusterInfo.baseDomain $INSTALL_DIR/crc-bundle-info.json)
1818
BUNDLE_TYPE=$(${JQ} -r .type $INSTALL_DIR/crc-bundle-info.json)
19-
ADDITIONAL_PACKAGES=""
19+
ADDITIONAL_PACKAGES="cloud-init"
2020

2121
case ${BUNDLE_TYPE} in
2222
microshift)
@@ -142,6 +142,9 @@ fi
142142
install_additional_packages ${VM_IP}
143143
cleanup_vm_image ${VM_NAME} ${VM_IP}
144144

145+
# Enable cloud-init service
146+
${SSH} core@${VM_IP} -- "sudo systemctl enable cloud-init cloud-config cloud-final"
147+
145148
# Delete all the pods except openshift-multus (which have file for crio cni config)
146149
# and lease from the etcd db so that when this bundle is use for the cluster provision, everything comes up in clean state.
147150
if [ ${BUNDLE_TYPE} != "microshift" ]; then
@@ -159,6 +162,9 @@ fi
159162

160163
podman_version=$(${SSH} core@${VM_IP} -- 'rpm -q --qf %{version} podman')
161164

165+
# Cleanup cloud-init config
166+
${SSH} core@${VM_IP} -- "sudo cloud-init clean --logs"
167+
162168
# Shutdown the VM
163169
shutdown_vm ${VM_NAME}
164170

0 commit comments

Comments
 (0)