aboutsummaryrefslogtreecommitdiffstats
path: root/extraconfig/post_deploy/example_run_on_update.yaml
blob: 4e378b147aab72a5007439d9401ec1c625de9a0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
heat_template_version: pike

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::SoftwareDeployments
    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}