diskimage-builder/diskimage_builder/elements/cloud-init/post-install.d/20-enable-cloud-init
Matthew Thode 902b7454c3
enable cloud-init by default on systemd
Change-Id: Ie908f7c5b9ea2c1b97daf149ef70f4c68ddf73a0
Signed-off-by: Matthew Thode <mthode@mthode.org>
2021-12-18 17:51:18 -06:00

23 lines
529 B
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
# gentoo
if [[ "${DIB_INIT_SYSTEM}" == "openrc" ]]; then
rc-update add cloud-config default
rc-update add cloud-final default
rc-update add cloud-init-local boot
rc-update add cloud-init default
fi
if [[ "${DIB_INIT_SYSTEM}" == "systemd" ]]; then
systemctl enable cloud-config.service
systemctl enable cloud-final.service
systemctl enable cloud-init-local.service
systemctl enable cloud-init.service
fi