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