aboutsummaryrefslogtreecommitdiffstats
path: root/extraconfig/post_deploy
diff options
context:
space:
mode:
authorSteven Hardy <shardy@redhat.com>2016-03-23 14:29:50 +0000
committerSteven Hardy <shardy@redhat.com>2016-03-23 14:29:50 +0000
commit8c0ba4c09ef26a1d83ab440baf2e739d6a85053b (patch)
tree2d0e36b7a144a4c6cdade66347ace9292648d5a8 /extraconfig/post_deploy
parent1dd6de571c79625ccf5520895b764bb9c2dd75d3 (diff)
Add ExtraConfig example that always runs on update
Some user feedback indicates we need better examples showing how we can run an extraconfig template, e.g on post-deploy so that it runs every update, regardless of if a change to the config has occurred. We can leverage DeployIdentifier for this, just like with the puppet deployments. This can be tested with an example like this: resource_registry: OS::TripleO::NodeExtraConfigPost: tripleo-heat-templates/extraconfig/post_deploy/example_run_on_update.yaml Change-Id: I45d8f8093ab45c03238ec56651c437128661cb95
Diffstat (limited to 'extraconfig/post_deploy')
-rw-r--r--extraconfig/post_deploy/example_run_on_update.yaml39
1 files changed, 39 insertions, 0 deletions
diff --git a/extraconfig/post_deploy/example_run_on_update.yaml b/extraconfig/post_deploy/example_run_on_update.yaml
new file mode 100644
index 0000000..234488a
--- /dev/null
+++ b/extraconfig/post_deploy/example_run_on_update.yaml
@@ -0,0 +1,39 @@
+heat_template_version: 2014-10-16
+
+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
+
+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}