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