OS::Heat::SoftwareDeployment and Image Requirements aka Diskimage builder
I'm attempting to launch a simple example template found in the Openstack/heat-templates repo, "example-puppet-template.yaml" Example Script Template
What I find is that the tools required to run this are not found inside the default cloud-image for CentOS-7.
I note that the instructions for prepairing a image with both the git repo's "test image" (Found Here) and the Software Deployment "Custom Image Script" (Found Here) both depend on using disk-image-builder.
The Script for diskimage-builder looks like the following, with CentOS7 and puppet:
# Clone the required repositories. Some of these are also available
# via pypi or as distro packages.
git clone https://git.openstack.org/openstack/diskimage-builder.git
git clone https://git.openstack.org/openstack/tripleo-image-elements.git
git clone https://git.openstack.org/openstack/heat-templates.git
# Required by diskimage-builder to discover element collections
export ELEMENTS_PATH=tripleo-image-elements/elements:heat-templates/hot/software-config/elements
# The base operating system element(s) provided by the diskimage-builder
# elements collection. Other values which may work include:
# centos7, debian, opensuse, rhel, rhel7, or ubuntu
export BASE_ELEMENTS="centos7 selinux-permissive"
# Install and configure the os-collect-config agent to poll the metadata
# server (heat service or zaqar message queue and so on) for configuration
# changes to execute
export AGENT_ELEMENTS="os-collect-config os-refresh-config os-apply-config"
# heat-config installs an os-refresh-config script which will invoke the
# appropriate hook to perform configuration. The element heat-config-script
# installs a hook to perform configuration with shell scripts
export DEPLOYMENT_BASE_ELEMENTS="heat-config heat-config-script"
# Install a hook for any other chosen configuration tool(s).
# Elements which install hooks include:
# heat-config-cfn-init, heat-config-puppet, or heat-config-salt
export DEPLOYMENT_TOOL="heat-config-puppet"
# The name of the qcow2 image to create, and the name of the image
# uploaded to the OpenStack image registry.
export IMAGE_NAME=centos-7-software-config
# Create the image
diskimage-builder/bin/disk-image-create vm $BASE_ELEMENTS $AGENT_ELEMENTS \
$DEPLOYMENT_BASE_ELEMENTS $DEPLOYMENT_TOOL -o $IMAGE_NAME.qcow2
# Upload the image, assuming valid credentials are already sourced
glance image-create --disk-format qcow2 --container-format bare \
--name $IMAGE_NAME < $IMAGE_NAME.qcow2
The example from docs.openstack.org uses virtualenv (which seems entirely unnecessary?) Is there a way to disable that?
So when launching a stack based off the above image created there's a few things that go wrong, the first and foremost is that the application jq is required by os-collect-config to report back to heat (I think?) and looks like the following in the logs:
dib-run-parts Wed Jan 18 19:56:03 UTC 2017 55-heat-config completed
dib-run-parts Wed Jan 18 19:56:03 UTC 2017 ----------------------- PROFILING -----------------------
dib-run-parts Wed Jan 18 19:56:03 UTC 2017
dib-run-parts Wed Jan 18 19:56:03 UTC 2017 Target: configure.d
dib-run-parts Wed Jan 18 19:56:03 UTC 2017
dib-run-parts Wed Jan 18 19:56:03 UTC 2017 Script Seconds
dib-run-parts Wed Jan 18 19:56:03 UTC 2017 --------------------------------------- ----------
dib-run-parts Wed Jan 18 19:56:03 UTC 2017
dib-run-parts Wed Jan 18 19:56:03 UTC 2017 20-os-apply-config 0.186
dib-run-parts Wed Jan 18 19:56:03 UTC 2017 55-heat-config 0.084
dib-run-parts Wed Jan 18 19:56:03 UTC 2017
dib-run-parts Wed Jan 18 19:56:03 UTC 2017 --------------------- END PROFILING ...