blob: c173e2c6ced97c3ee491db794e334df86347d486 [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:
139 type: OS::Heat::SoftwareConfig
140 properties:
141 config: |
142 #!/bin/sh
143 echo "user data script"
144
145 server:
146 type: OS::Nova::Server
147 properties:
148 image: {get_param: image}
149 flavor: {get_param: flavor}
150 key_name: {get_param: key_name}
151 security_groups:
152 - {get_resource: the_sg}
153 networks:
154 - network: {get_param: network}
155 user_data_format: SOFTWARE_CONFIG
Steve Baker856f5752015-03-09 14:34:28 +1300156 software_config_transport: {get_param: software_config_transport}
Steve Bakerf6c8f122015-02-10 13:54:46 +1300157 user_data: {get_resource: cfg_user_data}
158
159outputs:
160 res1:
161 value:
162 result: {get_attr: [dep1, result]}
163 stdout: {get_attr: [dep1, deploy_stdout]}
164 stderr: {get_attr: [dep1, deploy_stderr]}
165 status_code: {get_attr: [dep1, deploy_status_code]}
166 res2:
167 value:
168 result: {get_attr: [dep2b, result]}
169 stdout: {get_attr: [dep2b, deploy_stdout]}
170 stderr: {get_attr: [dep2b, deploy_stderr]}
171 status_code: {get_attr: [dep2b, deploy_status_code]}
172 res3:
173 value:
174 result: {get_attr: [dep3, result]}
175 stdout: {get_attr: [dep3, deploy_stdout]}
176 stderr: {get_attr: [dep3, deploy_stderr]}
177 status_code: {get_attr: [dep3, deploy_status_code]}