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