Merge "Switch mistral to use authtoken configuration"
[apex-tripleo-heat-templates.git] / puppet / cephstorage-role.yaml
1 heat_template_version: 2016-10-14
2 description: 'OpenStack ceph storage node configured by Puppet'
3 parameters:
4   OvercloudCephStorageFlavor:
5     description: Flavor for the Ceph Storage node.
6     default: baremetal
7     type: string
8     constraints:
9       - custom_constraint: nova.flavor
10   CephStorageImage:
11     type: string
12     default: overcloud-full
13     constraints:
14       - custom_constraint: glance.image
15   ImageUpdatePolicy:
16     default: 'REBUILD_PRESERVE_EPHEMERAL'
17     description: What policy to use when reconstructing instances. REBUILD for rebuilds, REBUILD_PRESERVE_EPHEMERAL to preserve /mnt.
18     type: string
19   KeyName:
20     description: Name of an existing Nova key pair to enable SSH access to the instances
21     type: string
22     default: default
23     constraints:
24       - custom_constraint: nova.keypair
25   ServiceNetMap:
26     default: {}
27     description: Mapping of service_name -> network name. Typically set
28                  via parameter_defaults in the resource registry.
29     type: json
30   EndpointMap:
31     default: {}
32     description: Mapping of service endpoint -> protocol. Typically set
33                  via parameter_defaults in the resource registry.
34     type: json
35   UpdateIdentifier:
36     default: ''
37     type: string
38     description: >
39       Setting to a previously unused value during stack-update will trigger
40       package update on all nodes
41   Hostname:
42     type: string
43     default: '' # Defaults to Heat created hostname
44   HostnameMap:
45     type: json
46     default: {}
47     description: Optional mapping to override hostnames
48   ExtraConfig:
49     default: {}
50     description: |
51       Additional hiera configuration to inject into the cluster. Note
52       that CephStorageExtraConfig takes precedence over ExtraConfig.
53     type: json
54   CephStorageExtraConfig:
55     default: {}
56     description: |
57       Role specific additional hiera configuration to inject into the cluster.
58     type: json
59   CephStorageIPs:
60     default: {}
61     type: json
62   NetworkDeploymentActions:
63     type: comma_delimited_list
64     description: >
65       Heat action when to apply network configuration changes
66     default: ['CREATE']
67   SoftwareConfigTransport:
68     default: POLL_SERVER_CFN
69     description: |
70       How the server should receive the metadata required for software configuration.
71     type: string
72     constraints:
73     - allowed_values: [POLL_SERVER_CFN, POLL_SERVER_HEAT, POLL_TEMP_URL, ZAQAR_MESSAGE]
74   CloudDomain:
75     default: 'localdomain'
76     type: string
77     description: >
78       The DNS domain used for the hosts. This should match the dhcp_domain
79       configured in the Undercloud neutron. Defaults to localdomain.
80   CephStorageServerMetadata:
81     default: {}
82     description: >
83       Extra properties or metadata passed to Nova for the created nodes in
84       the overcloud. It's accessible via the Nova metadata API. This option is
85       role-specific and is merged with the values given to the ServerMetadata
86       parameter.
87     type: json
88   ServerMetadata:
89     default: {}
90     description: >
91       Extra properties or metadata passed to Nova for the created nodes in
92       the overcloud. It's accessible via the Nova metadata API. This applies to
93       all roles and is merged with a role-specific metadata parameter.
94     type: json
95   CephStorageSchedulerHints:
96     type: json
97     description: Optional scheduler hints to pass to nova
98     default: {}
99   NodeIndex:
100     type: number
101     default: 0
102   ServiceConfigSettings:
103     type: json
104     default: {}
105   ServiceNames:
106     type: comma_delimited_list
107     default: []
108   MonitoringSubscriptions:
109     type: comma_delimited_list
110     default: []
111   ConfigCommand:
112     type: string
113     description: Command which will be run whenever configuration data changes
114     default: os-refresh-config --timeout 14400
115
116 resources:
117   CephStorage:
118     type: OS::TripleO::Server
119     metadata:
120       os-collect-config:
121         command: {get_param: ConfigCommand}
122     properties:
123       image: {get_param: CephStorageImage}
124       image_update_policy: {get_param: ImageUpdatePolicy}
125       flavor: {get_param: OvercloudCephStorageFlavor}
126       key_name: {get_param: KeyName}
127       networks:
128         - network: ctlplane
129       user_data_format: SOFTWARE_CONFIG
130       user_data: {get_resource: UserData}
131       name:
132         str_replace:
133             template: {get_param: Hostname}
134             params: {get_param: HostnameMap}
135       software_config_transport: {get_param: SoftwareConfigTransport}
136       metadata:
137         map_merge:
138           - {get_param: ServerMetadata}
139           - {get_param: CephStorageServerMetadata}
140       scheduler_hints: {get_param: CephStorageSchedulerHints}
141
142   # Combine the NodeAdminUserData and NodeUserData mime archives
143   UserData:
144     type: OS::Heat::MultipartMime
145     properties:
146       parts:
147       - config: {get_resource: NodeAdminUserData}
148         type: multipart
149       - config: {get_resource: NodeUserData}
150         type: multipart
151
152   # Creates the "heat-admin" user if configured via the environment
153   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
154   NodeAdminUserData:
155     type: OS::TripleO::NodeAdminUserData
156
157   # For optional operator additional userdata
158   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
159   NodeUserData:
160     type: OS::TripleO::NodeUserData
161
162   ExternalPort:
163     type: OS::TripleO::CephStorage::Ports::ExternalPort
164     properties:
165       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
166       IPPool: {get_param: CephStorageIPs}
167       NodeIndex: {get_param: NodeIndex}
168
169   InternalApiPort:
170     type: OS::TripleO::CephStorage::Ports::InternalApiPort
171     properties:
172       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
173       IPPool: {get_param: CephStorageIPs}
174       NodeIndex: {get_param: NodeIndex}
175
176   StoragePort:
177     type: OS::TripleO::CephStorage::Ports::StoragePort
178     properties:
179       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
180       IPPool: {get_param: CephStorageIPs}
181       NodeIndex: {get_param: NodeIndex}
182
183   StorageMgmtPort:
184     type: OS::TripleO::CephStorage::Ports::StorageMgmtPort
185     properties:
186       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
187       IPPool: {get_param: CephStorageIPs}
188       NodeIndex: {get_param: NodeIndex}
189
190   TenantPort:
191     type: OS::TripleO::CephStorage::Ports::TenantPort
192     properties:
193       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
194       IPPool: {get_param: CephStorageIPs}
195       NodeIndex: {get_param: NodeIndex}
196
197   ManagementPort:
198     type: OS::TripleO::CephStorage::Ports::ManagementPort
199     properties:
200       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
201       IPPool: {get_param: CephStorageIPs}
202       NodeIndex: {get_param: NodeIndex}
203
204   NetworkConfig:
205     type: OS::TripleO::CephStorage::Net::SoftwareConfig
206     properties:
207       ControlPlaneIp: {get_attr: [CephStorage, networks, ctlplane, 0]}
208       ExternalIpSubnet: {get_attr: [ExternalPort, ip_subnet]}
209       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
210       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
211       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
212       TenantIpSubnet: {get_attr: [TenantPort, ip_subnet]}
213       ManagementIpSubnet: {get_attr: [ManagementPort, ip_subnet]}
214
215   NetIpMap:
216     type: OS::TripleO::Network::Ports::NetIpMap
217     properties:
218       ControlPlaneIp: {get_attr: [CephStorage, networks, ctlplane, 0]}
219       ExternalIp: {get_attr: [ExternalPort, ip_address]}
220       ExternalIpSubnet: {get_attr: [ExternalPort, ip_subnet]}
221       ExternalIpUri: {get_attr: [ExternalPort, ip_address_uri]}
222       InternalApiIp: {get_attr: [InternalApiPort, ip_address]}
223       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
224       InternalApiIpUri: {get_attr: [InternalApiPort, ip_address_uri]}
225       StorageIp: {get_attr: [StoragePort, ip_address]}
226       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
227       StorageIpUri: {get_attr: [StoragePort, ip_address_uri]}
228       StorageMgmtIp: {get_attr: [StorageMgmtPort, ip_address]}
229       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
230       StorageMgmtIpUri: {get_attr: [StorageMgmtPort, ip_address_uri]}
231       TenantIp: {get_attr: [TenantPort, ip_address]}
232       TenantIpSubnet: {get_attr: [TenantPort, ip_subnet]}
233       TenantIpUri: {get_attr: [TenantPort, ip_address_uri]}
234       ManagementIp: {get_attr: [ManagementPort, ip_address]}
235       ManagementIpSubnet: {get_attr: [ManagementPort, ip_subnet]}
236       ManagementIpUri: {get_attr: [ManagementPort, ip_address_uri]}
237
238   NetHostMap:
239     type: OS::Heat::Value
240     properties:
241       type: json
242       value:
243         external:
244           fqdn:
245             list_join:
246             - '.'
247             - - {get_attr: [CephStorage, name]}
248               - external
249               - {get_param: CloudDomain}
250           short:
251             list_join:
252             - '.'
253             - - {get_attr: [CephStorage, name]}
254               - external
255         internal_api:
256           fqdn:
257             list_join:
258             - '.'
259             - - {get_attr: [CephStorage, name]}
260               - internalapi
261               - {get_param: CloudDomain}
262           short:
263             list_join:
264             - '.'
265             - - {get_attr: [CephStorage, name]}
266               - internalapi
267         storage:
268           fqdn:
269             list_join:
270             - '.'
271             - - {get_attr: [CephStorage, name]}
272               - storage
273               - {get_param: CloudDomain}
274           short:
275             list_join:
276             - '.'
277             - - {get_attr: [CephStorage, name]}
278               - storage
279         storage_mgmt:
280           fqdn:
281             list_join:
282             - '.'
283             - - {get_attr: [CephStorage, name]}
284               - storagemgmt
285               - {get_param: CloudDomain}
286           short:
287             list_join:
288             - '.'
289             - - {get_attr: [CephStorage, name]}
290               - storagemgmt
291         tenant:
292           fqdn:
293             list_join:
294             - '.'
295             - - {get_attr: [CephStorage, name]}
296               - tenant
297               - {get_param: CloudDomain}
298           short:
299             list_join:
300             - '.'
301             - - {get_attr: [CephStorage, name]}
302               - tenant
303         management:
304           fqdn:
305             list_join:
306             - '.'
307             - - {get_attr: [CephStorage, name]}
308               - management
309               - {get_param: CloudDomain}
310           short:
311             list_join:
312             - '.'
313             - - {get_attr: [CephStorage, name]}
314               - management
315         ctlplane:
316           fqdn:
317             list_join:
318             - '.'
319             - - {get_attr: [CephStorage, name]}
320               - ctlplane
321               - {get_param: CloudDomain}
322           short:
323             list_join:
324             - '.'
325             - - {get_attr: [CephStorage, name]}
326               - ctlplane
327
328   NetworkDeployment:
329     type: OS::TripleO::SoftwareDeployment
330     properties:
331       name: NetworkDeployment
332       config: {get_resource: NetworkConfig}
333       server: {get_resource: CephStorage}
334       actions: {get_param: NetworkDeploymentActions}
335
336   CephStorageDeployment:
337     type: OS::Heat::StructuredDeployment
338     depends_on: NetworkDeployment
339     properties:
340       name: CephStorageDeployment
341       config: {get_resource: CephStorageConfig}
342       server: {get_resource: CephStorage}
343       input_values:
344         enable_package_upgrade: {get_attr: [UpdateDeployment, update_managed_packages]}
345
346   CephStorageConfig:
347     type: OS::Heat::StructuredConfig
348     properties:
349       group: hiera
350       config:
351         hierarchy:
352           - '"%{::uuid}"'
353           - heat_config_%{::deploy_config_name}
354           - ceph_extraconfig
355           - extraconfig
356           - service_names
357           - service_configs
358           - ceph
359           - bootstrap_node # provided by allNodesConfig
360           - all_nodes # provided by allNodesConfig
361           - vip_data # provided by allNodesConfig
362           - '"%{::osfamily}"'
363         merge_behavior: deeper
364         datafiles:
365           service_names:
366             service_names: {get_param: ServiceNames}
367             sensu::subscriptions: {get_param: MonitoringSubscriptions}
368           service_configs:
369             map_replace:
370               - {get_param: ServiceConfigSettings}
371               - values: {get_attr: [NetIpMap, net_ip_map]}
372           ceph_extraconfig: {get_param: CephStorageExtraConfig}
373           extraconfig: {get_param: ExtraConfig}
374           ceph:
375             tripleo::packages::enable_upgrade: {get_input: enable_package_upgrade}
376             fqdn_internal_api: {get_attr: [NetHostMap, value, internal_api, fqdn]}
377             fqdn_storage: {get_attr: [NetHostMap, value, storage, fqdn]}
378             fqdn_storage_mgmt: {get_attr: [NetHostMap, value, storage_mgmt, fqdn]}
379             fqdn_tenant: {get_attr: [NetHostMap, value, tenant, fqdn]}
380             fqdn_management: {get_attr: [NetHostMap, value, management, fqdn]}
381             fqdn_ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]}
382
383   # Resource for site-specific injection of root certificate
384   NodeTLSCAData:
385     depends_on: CephStorageDeployment
386     type: OS::TripleO::NodeTLSCAData
387     properties:
388       server: {get_resource: CephStorage}
389
390   # Hook for site-specific additional pre-deployment config, e.g extra hieradata
391   CephStorageExtraConfigPre:
392     depends_on: CephStorageDeployment
393     type: OS::TripleO::CephStorageExtraConfigPre
394     properties:
395         server: {get_resource: CephStorage}
396
397   # Hook for site-specific additional pre-deployment config,
398   # applying to all nodes, e.g node registration/unregistration
399   NodeExtraConfig:
400     depends_on: [CephStorageExtraConfigPre, NodeTLSCAData]
401     type: OS::TripleO::NodeExtraConfig
402     properties:
403         server: {get_resource: CephStorage}
404
405   UpdateConfig:
406     type: OS::TripleO::Tasks::PackageUpdate
407
408   UpdateDeployment:
409     type: OS::Heat::SoftwareDeployment
410     properties:
411       config: {get_resource: UpdateConfig}
412       server: {get_resource: CephStorage}
413       input_values:
414         update_identifier:
415           get_param: UpdateIdentifier
416
417 outputs:
418   ip_address:
419     description: IP address of the server in the ctlplane network
420     value: {get_attr: [CephStorage, networks, ctlplane, 0]}
421   hostname:
422     description: Hostname of the server
423     value: {get_attr: [CephStorage, name]}
424   hostname_map:
425     description: Mapping of network names to hostnames
426     value:
427       external: {get_attr: [NetHostMap, value, external, fqdn]}
428       internal_api: {get_attr: [NetHostMap, value, internal_api, fqdn]}
429       storage: {get_attr: [NetHostMap, value, storage, fqdn]}
430       storage_mgmt: {get_attr: [NetHostMap, value, storage_mgmt, fqdn]}
431       tenant: {get_attr: [NetHostMap, value, tenant, fqdn]}
432       management: {get_attr: [NetHostMap, value, management, fqdn]}
433       ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]}
434   hosts_entry:
435     value:
436       str_replace:
437         template: |
438           PRIMARYIP PRIMARYHOST.DOMAIN PRIMARYHOST
439           EXTERNALIP EXTERNALHOST.DOMAIN EXTERNALHOST
440           INTERNAL_APIIP INTERNAL_APIHOST.DOMAIN INTERNAL_APIHOST
441           STORAGEIP STORAGEHOST.DOMAIN STORAGEHOST
442           STORAGE_MGMTIP STORAGE_MGMTHOST.DOMAIN STORAGE_MGMTHOST
443           TENANTIP TENANTHOST.DOMAIN TENANTHOST
444           MANAGEMENTIP MANAGEMENTHOST.DOMAIN MANAGEMENTHOST
445           CTLPLANEIP CTLPLANEHOST.DOMAIN CTLPLANEHOST
446         params:
447           PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, CephStorageHostnameResolveNetwork]}]}
448           DOMAIN: {get_param: CloudDomain}
449           PRIMARYHOST: {get_attr: [CephStorage, name]}
450           EXTERNALIP: {get_attr: [ExternalPort, ip_address]}
451           EXTERNALHOST: {get_attr: [NetHostMap, value, external, short]}
452           INTERNAL_APIIP: {get_attr: [InternalApiPort, ip_address]}
453           INTERNAL_APIHOST: {get_attr: [NetHostMap, value, internal_api, short]}
454           STORAGEIP: {get_attr: [StoragePort, ip_address]}
455           STORAGEHOST: {get_attr: [NetHostMap, value, storage, short]}
456           STORAGE_MGMTIP: {get_attr: [StorageMgmtPort, ip_address]}
457           STORAGE_MGMTHOST: {get_attr: [NetHostMap, value, storage_mgmt, short]}
458           TENANTIP: {get_attr: [TenantPort, ip_address]}
459           TENANTHOST: {get_attr: [NetHostMap, value, tenant, short]}
460           MANAGEMENTIP: {get_attr: [ManagementPort, ip_address]}
461           MANAGEMENTHOST: {get_attr: [NetHostMap, value, management, short]}
462           CTLPLANEIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
463           CTLPLANEHOST: {get_attr: [NetHostMap, value, ctlplane, short]}
464   nova_server_resource:
465     description: Heat resource handle for the ceph storage server
466     value:
467       {get_resource: CephStorage}
468   external_ip_address:
469     description: IP address of the server in the external network
470     value: {get_attr: [ExternalPort, ip_address]}
471   internal_api_ip_address:
472     description: IP address of the server in the internal_api network
473     value: {get_attr: [InternalApiPort, ip_address]}
474   storage_ip_address:
475     description: IP address of the server in the storage network
476     value: {get_attr: [StoragePort, ip_address]}
477   storage_mgmt_ip_address:
478     description: IP address of the server in the storage_mgmt network
479     value: {get_attr: [StorageMgmtPort, ip_address]}
480   tenant_ip_address:
481     description: IP address of the server in the tenant network
482     value: {get_attr: [TenantPort, ip_address]}
483   management_ip_address:
484     description: IP address of the server in the management network
485     value: {get_attr: [ManagementPort, ip_address]}