A simple template to test SoftwareComponent

This patch adds a basic template to test the new
OS::Heat::SoftwareComponent resource. It can be used, for example,
for development of required changes in in-instance tools.

OS::Heat::SoftwareComponent has been added during Juno development,
so this template will not work on earlier versions of Heat.

Change-Id: I3b7f257804f47fc032f9ec658ba9dee76abcc40e
HOT for IIS with Drupal

It deploys a new Drupal 7 web site on a server with IIS
and PHP 5.4 configured. Web site uses a local database on
SQL Server 2008 R2 SP2 Express

Required tools are downloaded from the internet using
official links. SHA1 hashes are computed for the downloaded files
and compared with the expected hashes to ensure file integrity.

The unit tests for the user data scripts are written using
Pester 3.0

Change-Id: Ia9c12db0a92fc4f39be9056c67471eb8c136a86a
Partially-Implements: blueprint windows-instances
Merge "A simple template to test SoftwareComponent"
Enable support for software component

The group property indicates whether it is softwarecomponent or plain
softwareconfig.
If it is softwarecomponent, recognizes 'configs' section in metadata,
and choose a proper config to invoke depending on the 'deploy_action'
value.

Partially implements: blueprint action-aware-sw-config

Change-Id: I503032ed09fb5448da225c53c690543fa30d957f
Software-config hook for ansible

Added ansible to the software-config README

Created a new folder elements/heat-config-ansible that will be
pre-installed by diskimage-builder on any images wishing to use the
ansible hook.

Created an example ansible heat template with an example ansible
script as a starting point.

Updated README.rst to reflect how heat-config-ansible interacts with the HOT template.

Change-Id: I861e96186e2f5d5b65ea5100edf1b82e753c425c
Merge "Software-config hook for ansible"
Restore execute bit on 55-heat-config

This was incorrectly removed on change
I503032ed09fb5448da225c53c690543fa30d957f

Change-Id: I0eba62b00c60fb7820045a447573b3dc86b046a4
Support files for unit test of software-config hooks

This change adds a tox.ini file including environments
for py26, py27 and pep8. These will be used to unit test the
hot software-config hooks.

Change-Id: Ieea12be77205d777a6b9c0f1c239418b9ce59d9f
Unit test of 55-heat-config

This implements a unit test of the os-refresh-config script 55-heat-config.

The test does the following:
- hook-fake.py is a fake hook which is executed for every config item
  found by 55-heat-config
- test_heat_config.HeatConfigTest does the following:
  - creates a temp dir and copies hook-fake.py into it for every
    hook/group name the test expects (puppet, script etc)
  - writes our sample config json and invokes 55-heat-config
    to trigger the execution of the fake hook for each config item
  - assert that the fake hooks wrote out the expected json for each
    config item

Change-Id: I87c108dc07dacde767b7f74c82c7ae06ab765738
flake8 fixes for software-config hooks

Fixed as raised by tox -epep8

Change-Id: I58412f82283e4aba1236e4cf7044ef6fd73400a9
Trigger cfn-init via script rather than lib

The current cfn-init software-config hook doesn't work at all
since cfn_helper is installed in a venv, not in site-packages.

This change switches to writing out metadata to
/var/cache/heat-cfntools/last_metadata and invoking cfn-init.

/var/lib/heat-cfntools/cfn-init-data cannot be used since that is
already populated with all boot metadata, which may still be used
by os-collect-config bootstrapping.

Change-Id: I7252a6f12223613b55b4b6417383673faa0d52b3
Closes-Bug: #1321513
Unit test of puppet hook

This test asserts the following when the puppet hook is invoked
with test data:
- Expected FACTER_* env variables are set
- Puppet is invoked with the expected arguments
- Written output files result in output values being set
- Puppet responding with a failure returncode propagates to the
  response

Change-Id: I987c9575bd51f53054c5f8e6c332aaa60a4a8f0c
Unit test of script hook

This test asserts the following when the script hook is invoked
with test data:
- Expected env variables are set
- Script contents matches the fake config tool contents
- Script is invoked with no arguments
- Written output files result in output values being set
- Script responding with a failure returncode propagates to the
  response

Change-Id: I1c32ec89b1ce16c25e3a29ab36e016cca5ff7835
Update image building steps in software-config README

dib-run-parts script used by diskimage-builder was moved to a
separate repository which has to be fetched and added to PATH.

Change-Id: Ie7e16ceda0efb4dca002607c0e6cad958a328bee
Merge "Update image building steps in software-config README"
Merge "Trigger cfn-init via script rather than lib"
Merge "Unit test of puppet hook"
Merge "Unit test of script hook"
Add ResourceGroup attribute example for all values

Adds an example showing how to get a list of all values
for an attribute of the resource in the group.  Related
to a question asked on IRC recently.

Change-Id: I106b66e94916464724295e79b90ef7ee5910a1b4
Use utf-8 encoding when writing config scripts

Change from default encoding 'ascii' to 'utf-8' encoding when writing
config scripts (stored in Heat software config's 'config' attribute).
The default ascii encoding causes issues when config scripts include
special characters.

Change-Id: I6f9135ad646ec4996c1c012ff11f7929404ecc3e
Closes-Bug: #1382031