diskimage-builder/elements/base/install.d/10-cloud-init
Monty Taylor 05356cbc09 Handle non-cloud-init installs
Not all operating-system elements install cloud-init, but the base
element assumes its existence. Create the directory if it does not
exist.

Change-Id: I4bda8dc5d200825ea0c8163a4e5c44050a45083f
2015-03-25 13:28:12 -04:00

14 lines
296 B
Bash
Executable file

#!/bin/bash
# Tweak the stock ubuntu cloud-init config
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
# cloud-init May not actually be installed
mkdir -p /etc/cloud/cloud.cfg.d
dd of=/etc/cloud/cloud.cfg.d/10_etc_hosts.cfg << EOF
manage_etc_hosts: localhost
EOF