Merge "Revert "Adjust MTU to compensate for VLAN tag issue""
[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   cloud_name_external:
6     type: string
7   cloud_name_internal_api:
8     type: string
9   cloud_name_storage:
10     type: string
11   cloud_name_storage_mgmt:
12     type: string
13   cloud_name_ctlplane:
14     type: string
15   # FIXME(shardy) this can be comma_delimited_list when
16   # https://bugs.launchpad.net/heat/+bug/1617019 is fixed
17   enabled_services:
18     type: string
19   controller_ips:
20     type: comma_delimited_list
21   logging_groups:
22     type: json
23   logging_sources:
24     type: json
25   service_ips:
26     type: json
27   service_node_names:
28     type: json
29   short_service_node_names:
30     type: json
31   controller_names:
32     type: comma_delimited_list
33   memcache_node_ips:
34     type: comma_delimited_list
35   NetVipMap:
36     type: json
37   RedisVirtualIP:
38     type: string
39     default: ''
40   ServiceNetMap:
41     type: json
42   DeployIdentifier:
43     type: string
44     default: ''
45     description: >
46       Setting this to a unique value will re-run any deployment tasks which
47       perform configuration on a Heat stack-update.
48   UpdateIdentifier:
49     type: string
50     description: >
51       Setting to a previously unused value during stack-update will trigger
52       package update on all nodes
53   StackAction:
54     type: string
55     description: >
56       Heat action on performed top-level stack.
57     constraints:
58     - allowed_values: ['CREATE', 'UPDATE']
59   # NOTE(jaosorior): This is being set as IPA as it's the first
60   # CA we'll actually be testing out. But we can change this if
61   # people request it.
62   CertmongerCA:
63     type: string
64     default: 'IPA'
65   EnableInternalTLS:
66     type: boolean
67     default: false
68
69 resources:
70
71   allNodesConfigImpl:
72     type: OS::Heat::StructuredConfig
73     properties:
74       group: os-apply-config
75       config:
76         hiera:
77           datafiles:
78             bootstrap_node:
79               mapped_data:
80                 bootstrap_nodeid: {get_input: bootstrap_nodeid}
81                 bootstrap_nodeid_ip: {get_input: bootstrap_nodeid_ip}
82             all_nodes:
83               mapped_data:
84                 map_merge:
85                   - tripleo::profile::base::logging::fluentd::fluentd_sources: {get_param: logging_sources}
86                   - tripleo::profile::base::logging::fluentd::fluentd_groups: {get_param: logging_groups}
87                   - enabled_services: {get_param: enabled_services}
88                   # This writes out a mapping of service_name_enabled: 'true'
89                   # For any services not enabled, hiera foo_enabled will
90                   # return nil, as it's undefined
91                   - map_merge:
92                       repeat:
93                         template:
94                           # Note this must be string 'true' due to
95                           # https://bugs.launchpad.net/heat/+bug/1617203
96                           SERVICE_enabled: 'true'
97                         for_each:
98                           SERVICE:
99                             str_split: [',', {get_param: enabled_services}]
100                   # Dynamically generate per-service network data
101                   # This works as follows (outer->inner functions)
102                   # yaql - filters services where no mapping exists in ServiceNetMap
103                   #   map_replace: substitute e.g heat_api_network with network name from ServiceNetMap
104                   #     map_merge/repeat: generate a per-service mapping
105                   - yaql:
106                       # This filters any entries where the value hasn't been substituted for
107                       # a list, e.g it's still $service_network.  This happens when there is
108                       # no network defined for the service in the ServiceNetMap, which is OK
109                       # as not all services have to be bound to a network, so we filter them
110                       expression: dict($.data.map.items().where(isString($[1]) and not $[1].endsWith("_network")))
111                       data:
112                         map:
113                           map_replace:
114                             - map_merge:
115                                 repeat:
116                                   template:
117                                     SERVICE_network: SERVICE_network
118                                   for_each:
119                                     SERVICE:
120                                       str_split: [',', {get_param: enabled_services}]
121                             - values: {get_param: ServiceNetMap}
122                   # Keystone doesn't provide separate entries for the public
123                   # and admin endpoints, so we need to add them here manually
124                   # like we do in the vip-config below
125                   - keystone_admin_api_network: {get_param: [ServiceNetMap, keystone_admin_api_network]}
126                     keystone_public_api_network: {get_param: [ServiceNetMap, keystone_public_api_network]}
127                   # provides a mapping of service_name_ips to a list of IPs
128                   - {get_param: service_ips}
129                   - {get_param: service_node_names}
130                   - {get_param: short_service_node_names}
131                   - controller_node_ips:
132                       list_join:
133                       - ','
134                       - {get_param: controller_ips}
135                     controller_node_names:
136                       list_join:
137                       - ','
138                       - {get_param: controller_names}
139                     memcached_node_ips_v6:
140                       str_replace:
141                         template: "['inet6:[SERVERS_LIST]']"
142                         params:
143                           SERVERS_LIST:
144                             list_join:
145                             - "]','inet6:["
146                             - {get_param: memcache_node_ips}
147
148                     deploy_identifier: {get_param: DeployIdentifier}
149                     update_identifier: {get_param: UpdateIdentifier}
150                     stack_action: {get_param: StackAction}
151             vip_data:
152               mapped_data:
153                 map_merge:
154                   # Dynamically generate per-service VIP data based on enabled_services
155                   # This works as follows (outer->inner functions)
156                   # yaql - filters services where no mapping exists in ServiceNetMap
157                   #   map_replace: substitute e.g internal_api with the IP from NetVipMap
158                   #     map_replace: substitute e.g heat_api_network with network name from ServiceNetMap
159                   #       map_merge/repeat: generate a per-service mapping
160                   - yaql:
161                       # This filters any entries where the value hasn't been substituted for
162                       # a list, e.g it's still $service_network.  This happens when there is
163                       # no network defined for the service in the ServiceNetMap, which is OK
164                       # as not all services have to be bound to a network, so we filter them
165                       expression: dict($.data.map.items().where(isString($[1]) and not $[1].endsWith("_network")))
166                       data:
167                         map:
168                           map_replace:
169                             - map_replace:
170                                 - map_merge:
171                                     repeat:
172                                       template:
173                                         SERVICE_vip: SERVICE_network
174                                       for_each:
175                                         SERVICE:
176                                           str_split: [',', {get_param: enabled_services}]
177                                 - values: {get_param: ServiceNetMap}
178                             - values: {get_param: NetVipMap}
179                   - keystone_admin_api_vip:
180                       get_param: [NetVipMap, {get_param: [ServiceNetMap, keystone_admin_api_network]}]
181                     keystone_public_api_vip:
182                       get_param: [NetVipMap, {get_param: [ServiceNetMap, keystone_public_api_network]}]
183                     public_virtual_ip: {get_param: [NetVipMap, external]}
184                     controller_virtual_ip: {get_param: [NetVipMap, ctlplane]}
185                     internal_api_virtual_ip: {get_param: [NetVipMap, internal_api]}
186                     storage_virtual_ip: {get_param: [NetVipMap, storage]}
187                     storage_mgmt_virtual_ip: {get_param: [NetVipMap, storage_mgmt]}
188                     redis_vip: {get_param: RedisVirtualIP}
189                     # public_virtual_ip and controller_virtual_ip are needed in
190                     # both HAproxy & keepalived.
191                     tripleo::haproxy::public_virtual_ip: {get_param: [NetVipMap, external]}
192                     tripleo::haproxy::controller_virtual_ip: {get_param: [NetVipMap, ctlplane]}
193                     tripleo::keepalived::public_virtual_ip: {get_param: [NetVipMap, external]}
194                     tripleo::keepalived::controller_virtual_ip: {get_param: [NetVipMap, ctlplane]}
195                     tripleo::keepalived::internal_api_virtual_ip: {get_param: [NetVipMap, internal_api]}
196                     tripleo::keepalived::storage_virtual_ip: {get_param: [NetVipMap, storage]}
197                     tripleo::keepalived::storage_mgmt_virtual_ip: {get_param: [NetVipMap, storage_mgmt]}
198                     tripleo::keepalived::redis_virtual_ip: {get_param: RedisVirtualIP}
199                     tripleo::redis_notification::haproxy_monitor_ip: {get_param: [NetVipMap, ctlplane]}
200                     cloud_name_external: {get_param: cloud_name_external}
201                     cloud_name_internal_api: {get_param: cloud_name_internal_api}
202                     cloud_name_storage: {get_param: cloud_name_storage}
203                     cloud_name_storage_mgmt: {get_param: cloud_name_storage_mgmt}
204                     cloud_name_ctlplane: {get_param: cloud_name_ctlplane}
205                     # TLS parameters
206                     certmonger_ca: {get_param: CertmongerCA}
207                     enable_internal_tls: {get_param: EnableInternalTLS}
208
209 outputs:
210   config_id:
211     description: The ID of the allNodesConfigImpl resource.
212     value:
213       {get_resource: allNodesConfigImpl}