Replace hard-coded regionOne with parameter references
[apex-tripleo-heat-templates.git] / extraconfig / all_nodes / random_string.yaml
1 heat_template_version: 2014-10-16
2
3 description: >
4   Example extra config for cluster config
5   this example deploys a random string to all controller and compute
6   nodes, showing how data may be shared amongst nodes, vs the
7   other ExtraConfig interfaces which act only on individual nodes.
8
9 # Parameters passed from the parent template - note if you maintain
10 # out-of-tree templates they may require additional parameters if the
11 # in-tree templates add a new role.
12 parameters:
13   controller_servers:
14     type: json
15   compute_servers:
16     type: json
17   blockstorage_servers:
18     type: json
19   objectstorage_servers:
20     type: json
21   cephstorage_servers:
22     type: json
23 # Note extra parameters can be defined, then passed data via the
24 # environment parameter_defaults, without modifying the parent template
25
26 resources:
27
28   Random:
29     type: OS::Heat::RandomString
30
31   RandomConfig:
32     type: OS::Heat::SoftwareConfig
33     properties:
34       group: script
35       inputs:
36       - name: random_value
37       config: |
38         #!/bin/sh
39         echo $random_value > /root/random_value
40
41   RandomDeploymentsController:
42     type: OS::Heat::SoftwareDeployments
43     properties:
44       name: RandomDeploymentsController
45       servers:  {get_param: controller_servers}
46       config: {get_resource: RandomConfig}
47       actions: ['CREATE'] # Only do this on CREATE
48       input_values:
49         random_value: {get_attr: [Random, value]}
50
51   RandomDeploymentsCompute:
52     type: OS::Heat::SoftwareDeployments
53     properties:
54       name: RandomDeploymentsCompute
55       servers:  {get_param: compute_servers}
56       config: {get_resource: RandomConfig}
57       actions: ['CREATE'] # Only do this on CREATE
58       input_values:
59         random_value: {get_attr: [Random, value]}