738e263b84cdd1b81244f3f78d6311e201196517
[apex-tripleo-heat-templates.git] / extraconfig / post_deploy / example_run_on_update.yaml
1 heat_template_version: ocata
2
3 description: >
4   Example extra config for post-deployment, this re-runs every update
5
6 # Note extra parameters can be defined, then passed data via the
7 # environment parameter_defaults, without modifying the parent template
8 parameters:
9   servers:
10     type: json
11   # This is provided via parameter_defaults from tripleoclient
12   # it changes to a new timestamp every update, so we can use it to
13   # trigger the deployment to run even though it and the config are
14   # otherwise unchanged
15   DeployIdentifier:
16     type: string
17
18 resources:
19
20   ExtraConfig:
21     type: OS::Heat::SoftwareConfig
22     properties:
23       group: script
24       inputs:
25         - name: deploy_identifier
26       config: |
27         #!/bin/sh
28         echo "extra_update $deploy_identifier" >> /root/extra_update
29
30   ExtraDeployments:
31     type: OS::Heat::SoftwareDeployments
32     properties:
33       name: ExtraDeployments
34       servers:  {get_param: servers}
35       config: {get_resource: ExtraConfig}
36       # Do this on CREATE/UPDATE (which is actually the default)
37       actions: ['CREATE', 'UPDATE']
38       input_values:
39         deploy_identifier: {get_param: DeployIdentifier}