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