Remove hard-coded per-service rabbitmq hieradata
[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   service_ips:
14     type: json
15   service_node_names:
16     type: json
17   controller_names:
18     type: comma_delimited_list
19   memcache_node_ips:
20     type: comma_delimited_list
21   keystone_public_api_node_ips:
22     type: comma_delimited_list
23   keystone_admin_api_node_ips:
24     type: comma_delimited_list
25   DeployIdentifier:
26     type: string
27     description: >
28       Setting this to a unique value will re-run any deployment tasks which
29       perform configuration on a Heat stack-update.
30   UpdateIdentifier:
31     type: string
32     description: >
33       Setting to a previously unused value during stack-update will trigger
34       package update on all nodes
35   StackAction:
36     type: string
37     description: >
38       Heat action on performed top-level stack.
39     constraints:
40     - allowed_values: ['CREATE', 'UPDATE']
41
42 resources:
43
44   allNodesConfigImpl:
45     type: OS::Heat::StructuredConfig
46     properties:
47       group: os-apply-config
48       config:
49         hosts:
50           list_join:
51           - "\n"
52           - {get_param: hosts}
53         hiera:
54           datafiles:
55             bootstrap_node:
56               mapped_data:
57                 bootstrap_nodeid: {get_input: bootstrap_nodeid}
58                 bootstrap_nodeid_ip: {get_input: bootstrap_nodeid_ip}
59             all_nodes:
60               mapped_data:
61                 map_merge:
62                   - enabled_services: {get_param: enabled_services}
63                   # This writes out a mapping of service_name_enabled: 'true'
64                   # For any services not enabled, hiera foo_enabled will
65                   # return nil, as it's undefined
66                   - map_merge:
67                       repeat:
68                         template:
69                           # Note this must be string 'true' due to
70                           # https://bugs.launchpad.net/heat/+bug/1617203
71                           SERVICE_enabled: 'true'
72                         for_each:
73                           SERVICE:
74                             str_split: [',', {get_param: enabled_services}]
75                   # provides a mapping of service_name_ips to a list of IPs
76                   - {get_param: service_ips}
77                   - {get_param: service_node_names}
78                   - controller_node_ips:
79                       list_join:
80                       - ','
81                       - {get_param: controller_ips}
82                     controller_node_names:
83                       list_join:
84                       - ','
85                       - {get_param: controller_names}
86                     memcached_node_ips_v6:
87                       str_replace:
88                         template: "['inet6:[SERVERS_LIST]']"
89                         params:
90                           SERVERS_LIST:
91                             list_join:
92                             - "]','inet6:["
93                             - {get_param: memcache_node_ips}
94                     keystone_public_api_node_ips:
95                       str_replace:
96                         template: "['SERVERS_LIST']"
97                         params:
98                           SERVERS_LIST:
99                             list_join:
100                             - "','"
101                             - {get_param: keystone_public_api_node_ips}
102                     keystone_admin_api_node_ips:
103                       str_replace:
104                         template: "['SERVERS_LIST']"
105                         params:
106                           SERVERS_LIST:
107                             list_join:
108                             - "','"
109                             - {get_param: keystone_admin_api_node_ips}
110
111                     deploy_identifier: {get_param: DeployIdentifier}
112                     update_identifier: {get_param: UpdateIdentifier}
113                     stack_action: {get_param: StackAction}
114
115 outputs:
116   config_id:
117     description: The ID of the allNodesConfigImpl resource.
118     value:
119       {get_resource: allNodesConfigImpl}
120   hosts_entries:
121     description: |
122       The content that should be appended to your /etc/hosts if you want to get
123       hostname-based access to the deployed nodes (useful for testing without
124       setting up a DNS).
125     value: {get_attr: [allNodesConfigImpl, config, hosts]}