diff --git a/elements/cloud-init/README.rst b/elements/cloud-init/README.rst new file mode 100644 index 00000000..3a1c8fef --- /dev/null +++ b/elements/cloud-init/README.rst @@ -0,0 +1,8 @@ +======== +cloud-init +======== + +Install's and enables cloud-init for systems that don't come with it +pre-installed + +Currently only supports Gentoo. diff --git a/elements/cloud-init/element-deps b/elements/cloud-init/element-deps new file mode 100644 index 00000000..7076aba9 --- /dev/null +++ b/elements/cloud-init/element-deps @@ -0,0 +1 @@ +package-installs diff --git a/elements/cloud-init/package-installs.yaml b/elements/cloud-init/package-installs.yaml new file mode 100644 index 00000000..5d5e70fd --- /dev/null +++ b/elements/cloud-init/package-installs.yaml @@ -0,0 +1 @@ +cloud-init: diff --git a/elements/cloud-init/pkg-map b/elements/cloud-init/pkg-map new file mode 100644 index 00000000..1845576d --- /dev/null +++ b/elements/cloud-init/pkg-map @@ -0,0 +1,7 @@ +{ + "family": { + "gentoo": { + "cloud-init": "app-emulation/cloud-init" + } + } +} diff --git a/elements/cloud-init/post-install.d/20-enable-cloud-init b/elements/cloud-init/post-install.d/20-enable-cloud-init new file mode 100755 index 00000000..6368bea5 --- /dev/null +++ b/elements/cloud-init/post-install.d/20-enable-cloud-init @@ -0,0 +1,15 @@ +#!/bin/bash + +if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then + set -x +fi +set -eu +set -o pipefail + +# gentoo +if [[ "${DISTRO_NAME}" == "gentoo" ]]; then + rc-update add cloud-config default + rc-update add cloud-final default + rc-update add cloud-init-local default + rc-update add cloud-init default +fi