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