ad10a8fc700397c4c1f26609924cf639df61d8c3
[apex-tripleo-heat-templates.git] / puppet / all-nodes-config.yaml
1 heat_template_version: 2015-04-30
2 description: 'All Nodes Config for Puppet'
3
4 parameters:
5   compute_hosts:
6     type: comma_delimited_list
7   controller_hosts:
8     type: comma_delimited_list
9   controller_ips:
10     type: comma_delimited_list
11   block_storage_hosts:
12     type: comma_delimited_list
13   object_storage_hosts:
14     type: comma_delimited_list
15   ceph_storage_hosts:
16     type: comma_delimited_list
17   controller_names:
18     type: comma_delimited_list
19   rabbit_node_ips:
20     type: comma_delimited_list
21   mongo_node_ips:
22     type: comma_delimited_list
23   redis_node_ips:
24     type: comma_delimited_list
25   memcache_node_ips:
26     type: comma_delimited_list
27   mysql_node_ips:
28     type: comma_delimited_list
29   horizon_node_ips:
30     type: comma_delimited_list
31   heat_api_node_ips:
32     type: comma_delimited_list
33   swift_proxy_node_ips:
34     type: comma_delimited_list
35   ceilometer_api_node_ips:
36     type: comma_delimited_list
37   aodh_api_node_ips:
38     type: comma_delimited_list
39   nova_api_node_ips:
40     type: comma_delimited_list
41   nova_metadata_node_ips:
42     type: comma_delimited_list
43   glance_api_node_ips:
44     type: comma_delimited_list
45   glance_registry_node_ips:
46     type: comma_delimited_list
47   cinder_api_node_ips:
48     type: comma_delimited_list
49   neutron_api_node_ips:
50     type: comma_delimited_list
51   keystone_public_api_node_ips:
52     type: comma_delimited_list
53   keystone_admin_api_node_ips:
54     type: comma_delimited_list
55   sahara_api_node_ips:
56     type: comma_delimited_list
57
58   DeployIdentifier:
59     type: string
60     description: >
61       Setting this to a unique value will re-run any deployment tasks which
62       perform configuration on a Heat stack-update.
63   UpdateIdentifier:
64     type: string
65     description: >
66       Setting to a previously unused value during stack-update will trigger
67       package update on all nodes
68   StackAction:
69     type: string
70     description: >
71       Heat action on performed top-level stack.
72     constraints:
73     - allowed_values: ['CREATE', 'UPDATE']
74
75 resources:
76
77   allNodesConfigImpl:
78     type: OS::Heat::StructuredConfig
79     properties:
80       group: os-apply-config
81       config:
82         hosts:
83           list_join:
84           - "\n"
85           - - list_join:
86               - "\n"
87               - {get_param: compute_hosts}
88             - list_join:
89               - "\n"
90               - {get_param: controller_hosts}
91             - list_join:
92               - "\n"
93               - {get_param: block_storage_hosts}
94             - list_join:
95               - "\n"
96               - {get_param: object_storage_hosts}
97             - list_join:
98               - "\n"
99               - {get_param: ceph_storage_hosts}
100         hiera:
101           datafiles:
102             RedHat:
103               raw_data: {get_file: hieradata/RedHat.yaml}
104             all_nodes:
105               mapped_data:
106                 controller_node_ips:
107                   list_join:
108                   - ','
109                   - {get_param: controller_ips}
110                 controller_node_names:
111                   list_join:
112                   - ','
113                   - {get_param: controller_names}
114                 galera_node_names:
115                   list_join:
116                   - ','
117                   - {get_param: controller_names}
118                 rabbit_node_ips: &rabbit_nodes_array
119                   str_replace:
120                     template: "['SERVERS_LIST']"
121                     params:
122                       SERVERS_LIST:
123                         list_join:
124                         - "','"
125                         - {get_param: rabbit_node_ips}
126                 mongo_node_ips:
127                   str_replace:
128                     template: "['SERVERS_LIST']"
129                     params:
130                       SERVERS_LIST:
131                         list_join:
132                         - "','"
133                         - {get_param: mongo_node_ips}
134                 redis_node_ips:
135                   str_replace:
136                     template: "['SERVERS_LIST']"
137                     params:
138                       SERVERS_LIST:
139                         list_join:
140                         - "','"
141                         - {get_param: redis_node_ips}
142                 memcache_node_ips:
143                   str_replace:
144                     template: "['SERVERS_LIST']"
145                     params:
146                       SERVERS_LIST:
147                         list_join:
148                         - "','"
149                         - {get_param: memcache_node_ips}
150                 memcache_node_ips_v6:
151                   str_replace:
152                     template: "['inet6:[SERVERS_LIST]']"
153                     params:
154                       SERVERS_LIST:
155                         list_join:
156                         - "]','inet6:["
157                         - {get_param: memcache_node_ips}
158                 mysql_node_ips:
159                   str_replace:
160                     template: "['SERVERS_LIST']"
161                     params:
162                       SERVERS_LIST:
163                         list_join:
164                         - "','"
165                         - {get_param: mysql_node_ips}
166                 horizon_node_ips:
167                   str_replace:
168                     template: "['SERVERS_LIST']"
169                     params:
170                       SERVERS_LIST:
171                         list_join:
172                         - "','"
173                         - {get_param: horizon_node_ips}
174                 heat_api_node_ips:
175                   str_replace:
176                     template: "['SERVERS_LIST']"
177                     params:
178                       SERVERS_LIST:
179                         list_join:
180                         - "','"
181                         - {get_param: heat_api_node_ips}
182                 swift_proxy_node_ips:
183                   str_replace:
184                     template: "['SERVERS_LIST']"
185                     params:
186                       SERVERS_LIST:
187                         list_join:
188                         - "','"
189                         - {get_param: swift_proxy_node_ips}
190                 ceilometer_api_node_ips:
191                   str_replace:
192                     template: "['SERVERS_LIST']"
193                     params:
194                       SERVERS_LIST:
195                         list_join:
196                         - "','"
197                         - {get_param: ceilometer_api_node_ips}
198                 aodh_api_node_ips:
199                   str_replace:
200                     template: "['SERVERS_LIST']"
201                     params:
202                       SERVERS_LIST:
203                         list_join:
204                         - "','"
205                         - {get_param: aodh_api_node_ips}
206                 nova_api_node_ips:
207                   str_replace:
208                     template: "['SERVERS_LIST']"
209                     params:
210                       SERVERS_LIST:
211                         list_join:
212                         - "','"
213                         - {get_param: nova_api_node_ips}
214                 nova_metadata_node_ips:
215                   str_replace:
216                     template: "['SERVERS_LIST']"
217                     params:
218                       SERVERS_LIST:
219                         list_join:
220                         - "','"
221                         - {get_param: nova_metadata_node_ips}
222                 glance_api_node_ips:
223                   str_replace:
224                     template: "['SERVERS_LIST']"
225                     params:
226                       SERVERS_LIST:
227                         list_join:
228                         - "','"
229                         - {get_param: glance_api_node_ips}
230                 glance_registry_node_ips:
231                   str_replace:
232                     template: "['SERVERS_LIST']"
233                     params:
234                       SERVERS_LIST:
235                         list_join:
236                         - "','"
237                         - {get_param: glance_registry_node_ips}
238                 cinder_api_node_ips:
239                   str_replace:
240                     template: "['SERVERS_LIST']"
241                     params:
242                       SERVERS_LIST:
243                         list_join:
244                         - "','"
245                         - {get_param: cinder_api_node_ips}
246                 neutron_api_node_ips:
247                   str_replace:
248                     template: "['SERVERS_LIST']"
249                     params:
250                       SERVERS_LIST:
251                         list_join:
252                         - "','"
253                         - {get_param: neutron_api_node_ips}
254                 # TODO: pass a `midonet_api_node_ips` var
255                 midonet_api_node_ips:
256                   str_replace:
257                     template: "['SERVERS_LIST']"
258                     params:
259                       SERVERS_LIST:
260                         list_join:
261                         - "','"
262                         - {get_param: neutron_api_node_ips}
263                 keystone_public_api_node_ips:
264                   str_replace:
265                     template: "['SERVERS_LIST']"
266                     params:
267                       SERVERS_LIST:
268                         list_join:
269                         - "','"
270                         - {get_param: keystone_public_api_node_ips}
271                 keystone_admin_api_node_ips:
272                   str_replace:
273                     template: "['SERVERS_LIST']"
274                     params:
275                       SERVERS_LIST:
276                         list_join:
277                         - "','"
278                         - {get_param: keystone_admin_api_node_ips}
279                 sahara_api_node_ips:
280                   str_replace:
281                     template: "['SERVERS_LIST']"
282                     params:
283                       SERVERS_LIST:
284                         list_join:
285                         - "','"
286                         - {get_param: sahara_api_node_ips}
287
288                 # NOTE(gfidente): interpolation with %{} in the
289                 # hieradata file can't be used as it returns string
290                 ceilometer::rabbit_hosts: *rabbit_nodes_array
291                 aodh::rabbit_hosts: *rabbit_nodes_array
292                 cinder::rabbit_hosts: *rabbit_nodes_array
293                 glance::notify::rabbitmq::rabbit_hosts: *rabbit_nodes_array
294                 heat::rabbit_hosts: *rabbit_nodes_array
295                 neutron::rabbit_hosts: *rabbit_nodes_array
296                 nova::rabbit_hosts: *rabbit_nodes_array
297                 keystone::rabbit_hosts: *rabbit_nodes_array
298                 sahara::rabbit_hosts: *rabbit_nodes_array
299
300                 deploy_identifier: {get_param: DeployIdentifier}
301                 update_identifier: {get_param: UpdateIdentifier}
302                 stack_action: {get_param: StackAction}
303
304 outputs:
305   config_id:
306     description: The ID of the allNodesConfigImpl resource.
307     value:
308       {get_resource: allNodesConfigImpl}
309   hosts_entries:
310     description: |
311       The content that should be appended to your /etc/hosts if you want to get
312       hostname-based access to the deployed nodes (useful for testing without
313       setting up a DNS).
314     value: {get_attr: [allNodesConfigImpl, config, hosts]}