diskimage-builder/diskimage_builder/elements/cloud-init-growpart/post-install.d/55-growpart
Rafal Lewandowski b73048f98d Added cloud-init growpart element
Added growpart element. It allows for growing specific partitions
during the deployment, which will result in less post deploy actions
needed for the server to be ready for use.

Change-Id: I6519fba3e8f1d078b99d3c03f2ac85f7b6e37d8a
2022-10-11 16:58:26 +02:00

26 lines
554 B
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
if [[ -n ${DIB_CLOUD_INIT_GROWPART_DEVICES} ]]; then
if [ -d /etc/cloud/cloud.cfg.d ]; then
cat > /etc/cloud/cloud.cfg.d/55-growpart.cfg <<EOF
#cloud-config
growpart:
mode: auto
devices: $DIB_CLOUD_INIT_GROWPART_DEVICES
ignore_growroot_disabled: false
EOF
else
echo "The /etc/cloud/cloud.cfg.d directory must exist."
exit 1
fi
else
echo "Set the device list in DIB_CLOUD_INIT_GROWPART_DEVICES."
exit 1
fi