blob: bf8fa9bbc176c1579192eeec9b6364ceeb0396e6 [file] [log] [blame]
Steve Bakerf6c8f122015-02-10 13:54:46 +13001heat_template_version: 2014-10-16
2parameters:
3 key_name:
4 type: string
5 flavor:
6 type: string
7 image:
8 type: string
9 network:
10 type: string
11 signal_transport:
12 type: string
13 default: CFN_SIGNAL
Steve Baker856f5752015-03-09 14:34:28 +130014 software_config_transport:
15 type: string
16 default: POLL_SERVER_CFN
Steve Bakerf6c8f122015-02-10 13:54:46 +130017 dep1_foo:
18 default: fooooo
19 type: string
20 dep1_bar:
21 default: baaaaa
22 type: string
23 dep2a_bar:
24 type: string
25 default: barrr
26 dep3_foo:
27 default: fo
28 type: string
29 dep3_bar:
30 default: ba
31 type: string
32
33resources:
34
35 the_sg:
36 type: OS::Neutron::SecurityGroup
37 properties:
38 name: the_sg
39 description: Ping and SSH
40 rules:
41 - protocol: icmp
42 - protocol: tcp
43 port_range_min: 22
44 port_range_max: 22
45
46 cfg1:
47 type: OS::Heat::SoftwareConfig
48 properties:
49 group: script
50 inputs:
51 - name: foo
52 - name: bar
53 outputs:
54 - name: result
55 config: {get_file: cfg1.sh}
56
57 cfg2a:
58 type: OS::Heat::StructuredConfig
59 properties:
60 group: cfn-init
61 inputs:
62 - name: bar
63 config:
64 config:
65 files:
66 /tmp/cfn-init-foo:
67 content:
68 get_input: bar
69 mode: '000644'
70
71 cfg2b:
72 type: OS::Heat::SoftwareConfig
73 properties:
74 group: script
75 outputs:
76 - name: result
77 config: |
78 #!/bin/sh
79 echo -n "The file /tmp/cfn-init-foo contains `cat /tmp/cfn-init-foo` for server $deploy_server_id during $deploy_action" > $heat_outputs_path.result
80
81 cfg3:
82 type: OS::Heat::SoftwareConfig
83 properties:
84 group: puppet
85 inputs:
86 - name: foo
87 - name: bar
88 outputs:
89 - name: result
90 config: {get_file: cfg3.pp}
91
92 dep1:
93 type: OS::Heat::SoftwareDeployment
94 properties:
95 config:
96 get_resource: cfg1
97 server:
98 get_resource: server
99 input_values:
100 foo: {get_param: dep1_foo}
101 bar: {get_param: dep1_bar}
102 signal_transport: {get_param: signal_transport}
103
104 dep2a:
105 type: OS::Heat::StructuredDeployment
106 properties:
107 name: 10_dep2a
108 signal_transport: NO_SIGNAL
109 config:
110 get_resource: cfg2a
111 server:
112 get_resource: server
113 input_values:
114 bar: {get_param: dep2a_bar}
115
116 dep2b:
117 type: OS::Heat::SoftwareDeployment
118 properties:
119 name: 20_dep2b
120 config:
121 get_resource: cfg2b
122 server:
123 get_resource: server
124 signal_transport: {get_param: signal_transport}
125
126 dep3:
127 type: OS::Heat::SoftwareDeployment
128 properties:
129 config:
130 get_resource: cfg3
131 server:
132 get_resource: server
133 input_values:
134 foo: {get_param: dep3_foo}
135 bar: {get_param: dep3_bar}
136 signal_transport: {get_param: signal_transport}
137
138 cfg_user_data:
Steve Baker0b679bb2015-03-11 13:46:42 +1300139 type: Heat::InstallConfigAgent
Steve Bakerf6c8f122015-02-10 13:54:46 +1300140
141 server:
142 type: OS::Nova::Server
143 properties:
144 image: {get_param: image}
145 flavor: {get_param: flavor}
146 key_name: {get_param: key_name}
147 security_groups:
148 - {get_resource: the_sg}
149 networks:
150 - network: {get_param: network}
151 user_data_format: SOFTWARE_CONFIG
Steve Baker856f5752015-03-09 14:34:28 +1300152 software_config_transport: {get_param: software_config_transport}
Steve Baker0b679bb2015-03-11 13:46:42 +1300153 user_data: {get_attr: [cfg_user_data, config]}
Steve Bakerf6c8f122015-02-10 13:54:46 +1300154
155outputs:
156 res1:
157 value:
158 result: {get_attr: [dep1, result]}
159 stdout: {get_attr: [dep1, deploy_stdout]}
160 stderr: {get_attr: [dep1, deploy_stderr]}
161 status_code: {get_attr: [dep1, deploy_status_code]}
162 res2:
163 value:
164 result: {get_attr: [dep2b, result]}
165 stdout: {get_attr: [dep2b, deploy_stdout]}
166 stderr: {get_attr: [dep2b, deploy_stderr]}
167 status_code: {get_attr: [dep2b, deploy_status_code]}
168 res3:
169 value:
170 result: {get_attr: [dep3, result]}
171 stdout: {get_attr: [dep3, deploy_stdout]}
172 stderr: {get_attr: [dep3, deploy_stderr]}
173 status_code: {get_attr: [dep3, deploy_status_code]}