Remove all deprecated hooks and tests.
Also since all test and hooks are removed,
we can remove the declare of python language in classifier.
Since we didn't actually provide any document,
we should remove docs too.
Hooks are maintained as Agents under heat-agents repo now.
Hooks in heat-templates are deprecated for a while. Hence, remove
hooks in heat-templates.
Depends-On: https://review.openstack.org/#/c/584774/
Change-Id: Ia886f71eaf99d75db0f9a6a7dfbe8664995c26e7
This patch adds a new Heat software configuration hook that
can be used to generate Json config files in a composable manner
within Heat templates.
This can be useful for everything from providing data to ad-hoc
scripts from configuring kolla containers.
Change-Id: I2b372ac2e291339e436202c9fe58a681ed6a743f
Early in a server boot the file /var/run/heat-config/heat-config may
exist but be empty. This causes a stack trace to be raised in this
script.
This change detects a json parse error and exits gracefully.
Change-Id: I29d731098659bfbf10a2caf80c2cfc49de5df4cc
Closes-Bug: #1648249
What the heat-config-notify actually POSTs/PUTs to heat is JSON, so
the content-type should be updated as such.
Change-Id: I85e116bec524ba37e96c5761346084ab149601cc
Related-Bug: #1641589
This change updates the puppet hook to write out logs to the local node
if verbose or debug is enabled for the hook. The logs will be written
out to the /var/log/puppet/ folder that currently is empty at all times.
We will continue to output logs to the console for the traditional heat
processing of the stdout and stderr but will also write out the logs
locally only if debug or verbose is enabled for the puppet apply.
Change-Id: Idfbfc030350827a4653b26cef7c7deca92b0e05d
Closes-Bug: #1536009
This hook takes the same format as the docker-compose hook, but makes
calls directly to the docker command rather than calling
docker-compose.
This hook currently supports the docker-compose v1 format, but in the
future will support other formats such as the kubernetes pod format.
TripleO will adopt this hook and will transition to using the pod
format when this hook supports it.
Co-Authored-By: Ian Main <imain@redhat.com>
Change-Id: I699107c3df64723a945c5d5ac82ae3a48b76700e
Currently we don't support options for the ansible hook, but it would
be useful to enable passing tags, like we already do for the puppet
hook.
Change-Id: Idf7e3aa520fd40a2c4c00b2d26c3c608059bb51d
This patch creates a hook that writes hiera.yaml and datafiles
to disk. This approach works well for users (like TripleO)
who prefer to maintain Hiera in a more composable manner with
Heat structured config resources rather than specifying all
the Hiera values for each puppet config resource.
Partial-bug: #1596373
Change-Id: I21639f6aadabf9e49f40d1bb0b1d0edcfc4dbc5e
The intent is for this element (hook script) to be used in place of the
one in tripleo-image-elements which relies on an external signal handling
shell script at the end of the os-refresh-config run
(99-refresh-completed).
This version will run os-apply-config and return a signal immediately.
Because it uses the heat-hook mechanisms it also supports a broader set of
signal handling capabilities... which 99-refresh-completed doesn't fully
support.
Change-Id: Ic9402ff93cbc840bec1debcd8881de563d03cbf0
This allow the user to pass a string (or path to a file) for the
ansible inventory so it is not just localhost. This is important for
things like setting up groups and possible inventory scoped variables.
Added test to ensure ansible is getting called properly using the ENV
inventory value.
Change-Id: I9440ff9dae3595a1c57b2511f03792105f1beb88
Implements a software config hook for using chef-zero, an in-memory,
standalone chef service. Chef-Zero has replaced chef-solo as the
preferred serverless implementation, therfore this patch replaces
the previous chef-solo patch at https://review.openstack.org/#/c/80229/.
Change-Id: Ic93b2e67be0c07e27d26ed2c6677c5a0f1b42e07
Closes-Bug: #1279062
Deployments should not be run again when a server is rebooted because
heat will likely not be listening for the deployment signals. This
change moves the deployed directory from /var/run/heat-config/deployed
to /var/lib/heat-config/deployed so that deployed state is persisted
across reboots.
There is migration logic to move the existing files from the old to the
new location, this will only be run on the first run of 55-heat-config
after its package is updated.
Change-Id: I3d305a4ac5b68c29037760682d37e5b9a530828e
Closes-Bug: #1513220
Salt does not always return 0 on success so verify actual
task results on non-zero return codes. Also add test for
salt config hook.
Change-Id: Ib848ef27ae29417ca38874d8310bdcd2bc35e2c3
Co-Authored-By: Chris Hultin <Chris.Hultin@rackspace.com>
Closes-Bug: #1483336
Currently the output of Puppet run is written to os-collect-config log only.
If the run gets stuck, we have zero output from it, and have no chance
of guessing where it got stuck. This patch is fixing this issue and also adds
support for running Puppet in debug mode.
Due to big amount of data stdout and stderr in response during debug mode,
both are trimmed so that we won't exceed max_json_body_size(1048576).
Resolves-bug: rhbz#1242396
Change-Id: Ie92d1714a8d7e59d347474039be999bd3a2b542f
Using --tags allows you to run a puppet manifest and only apply
a subset of the catalog. You can specify --tags package for
example to only install packages resources for a given
manifest.
The intent is to use this option alongside of the TripleO docker
work to selectively control what parts of a puppet manifest
get executed in a container.
Change-Id: Ic8b54c89e62cbe5074f256e29e10f59aa2ab0aae
Latest docker-compose only recreates containers whose
configurationhas changed since they were created[1].
This patch uses sd 'name' rather than 'id' for the
project name that helps in recreating containers with
the same name after an update. Also changes
docker-compose version to 1.4.0.
[1] https://github.com/docker/compose/releases/tag/1.4.0
Change-Id: Ia9b8621c8785b55551a0660fed0148b15ab4f20c
The puppet hook for heat software-deployments now has the option
to specify a modulepath to use when running puppet. This will
allow users to perform different sofware deployments with different
or even overlapping puppet modules, by specifying the exact path
to source modules from.
Change-Id: I9a07f4468f0b9468635fa74628d5f2f1c2bbe978
Atomic hook can be used with bootconfig to deply containers using
atomic tool in rhel 7.1. This patch adds test and exmaple template
for the hook.
Change-Id: I0f2469225027f3d37c7dd59f85dee8b5aa24a874
Added support for `env_file` which can be single file or a list
of files. Use special input 'env_files' for the env_files. These
files will be created by the hook relative to the compose project
directory.
if 'env_file' entries in 'docker-compose.yml' do not exist in the
`input_values` supplied, docker-compose will throw an error as it
can't find these files.
Change-Id: I0dbe80e8c8c56cc680f8ee86b4f34cf3d27533c4
This hook uses the kubelet agent from the kubernetes project
to provision containers. The StructuredConfig resource data
represents a pod of containers to be provisioned.
The files have the following purpose:
- extra-data.d/50-docker-images allows an archive file of docker images to
be included in the dib image
- install.d/50-heat-config-kubelet installs kubernetes for redhat based distros
during dib image build, along with the required systemd and config files required
to enable a working kubelet service on the host
- install.d/hook-kubelet.py polls docker images and containers until the expected
kubelet-provisioned containers are running (or a timeout occurs)
- os-refresh-config/configure.d/50-heat-config-kubelet runs before 55-heat-config
(and the kubelet hook it triggers). This orc script writes out all pod definition files
for the pods that should currently be running. Kubelet is configured to monitor
the directory containing these files, so the current running containers will
change when kubelet acts on these config changes
Author: Steve Baker <sbaker@redhat.com>
Co-Authored-By: Rabi Mishra <ramishra@redhat.com>
Change-Id: Iabb844c7d8a6f916093c364ad8caa0dbe50df3dd
This hook which uses 'docker-compose' to deploy containers.
The StructuredConfig resource data represents a 'docker-compose'
project that can include more than one services/containers.
Change-Id: I63074c51f59893ba4c6500eae2f42fa5bd7ed061
Closes-Bug: #1426223
Other hooks process json then execute commands. The docker hook
makes socket API calls via the docker-py module. For this reason
a different approach has been taken with testing this hook:
- symlink hook-docker.py to the tests package as hook_docker.py
- in the test, mock out the docker import and run main() directly
Change-Id: Ia069b2cc0db71952732dea310a8986b73981b656
The URL for deploy_signal_id is called with POST by default, however some
signals need to be called with PUT (specifically signals backed by swift
objects).
This change uses the value of deploy_signal_verb for POST or PUT, using
POST by default.
Change-Id: I8c83fa34cad9b1e91abcfc7e26e04b21cdc9bde4
Partial-Blueprint: software-config-swift-signal
Currently signalling heat is done in a chunk of python at the end
of 55-heat-config. This change moves the signalling to its own
command heat-config-notify, which can be called from 55-heat-config
or anything else which wants to signal heat.
This change also adds proper test coverage to the signalling logic.
Change-Id: I6ba7468b46ca8cfad1e58207cd3f814a178ff6f1
Previously 55-heat-config assumed that executing a hook with some
config is an idempotent operation, so it made no effort to prevent
a hook being invoked with the same config multiple times. This means
that whenever *any* deployment metadata changes *all* configs are
run against their hooks again. This would be undesirable for
non-idempotent configs, or configs which are expensive to execute.
This change writes out the config json to files in
/var/run/heat-config/deployed and uses the presence of this file to
determine whether that config has been deployed already. This also
improves the debugging experience as a single hook execution can be
triggered manually by running:
/var/lib/heat-config/hooks/<hook> < /var/run/heat-config/deployed/<cid>.json
Closes-Bug: #1376008
Closes-Bug: #1365302
Change-Id: Id2d2f623508be3049a7db8a39f5444ccac9257d6
Updates the puppet hook so that we support using Hiera in addition
to the existing Facter based input mechanism. Hiera provides
a more flexible way of dealing with puppet parameters and
seems to be prefered in the Puppet community as well.
Use of the Hiera data will also require an additional
'hiera' element which will probably live in the
triple-puppet-elements tree.
Change-Id: I497f2d2286025e48e42691bfe178fc9c491928ea
This patch adds conversion of Json type input into a string so that it
can be consumed by scripts (e.g. Python or Bash).
Change-Id: I715819dc8e0c1c9119b544330d5b0c77e9c2f924
Closes-Bug: #1392802
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
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
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