tripleo-heat-templates/extraconfig/post_deploy/example_run_on_update.yaml
ramishra c9991c2e31 Use 'wallaby' heat_template_version
With I57047682cfa82ba6ca4affff54fab5216e9ba51c Heat has added
a new template version for wallaby. This would allow us to use
2-argument variant of the ``if`` function that would allow for
 e.g. conditional definition of resource properties and help
cleanup templates. If only two arguments are passed to ``if``
function, the entire enclosing item is removed when the condition
is false.

Change-Id: I25f981b60c6a66b39919adc38c02a051b6c51269
2021-03-31 17:35:12 +05:30

43 lines
1.3 KiB
YAML

heat_template_version: wallaby
description: >
Example extra config for post-deployment, this re-runs every update
# Note extra parameters can be defined, then passed data via the
# environment parameter_defaults, without modifying the parent template
parameters:
servers:
type: json
# This is provided via parameter_defaults from tripleoclient
# it changes to a new timestamp every update, so we can use it to
# trigger the deployment to run even though it and the config are
# otherwise unchanged
DeployIdentifier:
type: string
default: ''
description: >
Setting this to a unique value will re-run any deployment tasks which perform configuration on a Heat stack-update.
resources:
ExtraConfig:
type: OS::Heat::SoftwareConfig
properties:
group: script
inputs:
- name: deploy_identifier
config: |
#!/bin/sh
echo "extra_update $deploy_identifier" >> /root/extra_update
ExtraDeployments:
type: OS::Heat::SoftwareDeploymentGroup
properties:
name: ExtraDeployments
servers: {get_param: servers}
config: {get_resource: ExtraConfig}
# Do this on CREATE/UPDATE (which is actually the default)
actions: ['CREATE', 'UPDATE']
input_values:
deploy_identifier: {get_param: DeployIdentifier}