Merge "Revert "Adjust MTU to compensate for VLAN tag issue""
[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     type: string
76     description: >
77       The DNS domain used for the hosts. This should match the dhcp_domain
78       configured in the Undercloud neutron. Defaults to localdomain.
79   ServerMetadata:
80     default: {}
81     description: >
82       Extra properties or metadata passed to Nova for the created nodes in
83       the overcloud. It's accessible via the Nova metadata API.
84     type: json
85   CephStorageSchedulerHints:
86     type: json
87     description: Optional scheduler hints to pass to nova
88     default: {}
89   NodeIndex:
90     type: number
91     default: 0
92   ServiceConfigSettings:
93     type: json
94     default: {}
95   ServiceNames:
96     type: comma_delimited_list
97     default: []
98   MonitoringSubscriptions:
99     type: comma_delimited_list
100     default: []
101   ConfigCommand:
102     type: string
103     description: Command which will be run whenever configuration data changes
104     default: os-refresh-config --timeout 14400
105
106 resources:
107   CephStorage:
108     type: OS::TripleO::Server
109     metadata:
110       os-collect-config:
111         command: {get_param: ConfigCommand}
112     properties:
113       image: {get_param: CephStorageImage}
114       image_update_policy: {get_param: ImageUpdatePolicy}
115       flavor: {get_param: OvercloudCephStorageFlavor}
116       key_name: {get_param: KeyName}
117       networks:
118         - network: ctlplane
119       user_data_format: SOFTWARE_CONFIG
120       user_data: {get_resource: UserData}
121       name:
122         str_replace:
123             template: {get_param: Hostname}
124             params: {get_param: HostnameMap}
125       software_config_transport: {get_param: SoftwareConfigTransport}
126       metadata: {get_param: ServerMetadata}
127       scheduler_hints: {get_param: CephStorageSchedulerHints}
128
129   # Combine the NodeAdminUserData and NodeUserData mime archives
130   UserData:
131     type: OS::Heat::MultipartMime
132     properties:
133       parts:
134       - config: {get_resource: NodeAdminUserData}
135         type: multipart
136       - config: {get_resource: NodeUserData}
137         type: multipart
138
139   # Creates the "heat-admin" user if configured via the environment
140   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
141   NodeAdminUserData:
142     type: OS::TripleO::NodeAdminUserData
143
144   # For optional operator additional userdata
145   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
146   NodeUserData:
147     type: OS::TripleO::NodeUserData
148
149   ExternalPort:
150     type: OS::TripleO::CephStorage::Ports::ExternalPort
151     properties:
152       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
153       IPPool: {get_param: CephStorageIPs}
154       NodeIndex: {get_param: NodeIndex}
155
156   InternalApiPort:
157     type: OS::TripleO::CephStorage::Ports::InternalApiPort
158     properties:
159       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
160       IPPool: {get_param: CephStorageIPs}
161       NodeIndex: {get_param: NodeIndex}
162
163   StoragePort:
164     type: OS::TripleO::CephStorage::Ports::StoragePort
165     properties:
166       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
167       IPPool: {get_param: CephStorageIPs}
168       NodeIndex: {get_param: NodeIndex}
169
170   StorageMgmtPort:
171     type: OS::TripleO::CephStorage::Ports::StorageMgmtPort
172     properties:
173       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
174       IPPool: {get_param: CephStorageIPs}
175       NodeIndex: {get_param: NodeIndex}
176
177   TenantPort:
178     type: OS::TripleO::CephStorage::Ports::TenantPort
179     properties:
180       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
181       IPPool: {get_param: CephStorageIPs}
182       NodeIndex: {get_param: NodeIndex}
183
184   ManagementPort:
185     type: OS::TripleO::CephStorage::Ports::ManagementPort
186     properties:
187       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
188       IPPool: {get_param: CephStorageIPs}
189       NodeIndex: {get_param: NodeIndex}
190
191   NetworkConfig:
192     type: OS::TripleO::CephStorage::Net::SoftwareConfig
193     properties:
194       ControlPlaneIp: {get_attr: [CephStorage, networks, ctlplane, 0]}
195       ExternalIpSubnet: {get_attr: [ExternalPort, ip_subnet]}
196       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
197       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
198       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
199       TenantIpSubnet: {get_attr: [TenantPort, ip_subnet]}
200       ManagementIpSubnet: {get_attr: [ManagementPort, ip_subnet]}
201
202   NetIpMap:
203     type: OS::TripleO::Network::Ports::NetIpMap
204     properties:
205       ControlPlaneIp: {get_attr: [CephStorage, networks, ctlplane, 0]}
206       ExternalIp: {get_attr: [ExternalPort, ip_address]}
207       ExternalIpSubnet: {get_attr: [ExternalPort, ip_subnet]}
208       ExternalIpUri: {get_attr: [ExternalPort, ip_address_uri]}
209       InternalApiIp: {get_attr: [InternalApiPort, ip_address]}
210       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
211       InternalApiIpUri: {get_attr: [InternalApiPort, ip_address_uri]}
212       StorageIp: {get_attr: [StoragePort, ip_address]}
213       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
214       StorageIpUri: {get_attr: [StoragePort, ip_address_uri]}
215       StorageMgmtIp: {get_attr: [StorageMgmtPort, ip_address]}
216       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
217       StorageMgmtIpUri: {get_attr: [StorageMgmtPort, ip_address_uri]}
218       TenantIp: {get_attr: [TenantPort, ip_address]}
219       TenantIpSubnet: {get_attr: [TenantPort, ip_subnet]}
220       TenantIpUri: {get_attr: [TenantPort, ip_address_uri]}
221       ManagementIp: {get_attr: [ManagementPort, ip_address]}
222       ManagementIpSubnet: {get_attr: [ManagementPort, ip_subnet]}
223       ManagementIpUri: {get_attr: [ManagementPort, ip_address_uri]}
224
225   NetworkDeployment:
226     type: OS::TripleO::SoftwareDeployment
227     properties:
228       name: NetworkDeployment
229       config: {get_resource: NetworkConfig}
230       server: {get_resource: CephStorage}
231       actions: {get_param: NetworkDeploymentActions}
232
233   CephStorageDeployment:
234     type: OS::Heat::StructuredDeployment
235     depends_on: NetworkDeployment
236     properties:
237       name: CephStorageDeployment
238       config: {get_resource: CephStorageConfig}
239       server: {get_resource: CephStorage}
240       input_values:
241         enable_package_upgrade: {get_attr: [UpdateDeployment, update_managed_packages]}
242
243   CephStorageConfig:
244     type: OS::Heat::StructuredConfig
245     properties:
246       group: os-apply-config
247       config:
248         hiera:
249           hierarchy:
250             - '"%{::uuid}"'
251             - heat_config_%{::deploy_config_name}
252             - ceph_extraconfig
253             - extraconfig
254             - service_names
255             - service_configs
256             - ceph
257             - bootstrap_node # provided by allNodesConfig
258             - all_nodes # provided by allNodesConfig
259             - vip_data # provided by allNodesConfig
260             - '"%{::osfamily}"'
261           merge_behavior: deeper
262           datafiles:
263             service_names:
264               mapped_data:
265                 service_names: {get_param: ServiceNames}
266                 sensu::subscriptions: {get_param: MonitoringSubscriptions}
267             service_configs:
268               mapped_data:
269                 map_replace:
270                   - {get_param: ServiceConfigSettings}
271                   - values: {get_attr: [NetIpMap, net_ip_map]}
272             ceph_extraconfig:
273               mapped_data: {get_param: CephStorageExtraConfig}
274             extraconfig:
275               mapped_data: {get_param: ExtraConfig}
276             ceph:
277               mapped_data:
278                 tripleo::packages::enable_upgrade: {get_input: enable_package_upgrade}
279
280   # Resource for site-specific injection of root certificate
281   NodeTLSCAData:
282     depends_on: CephStorageDeployment
283     type: OS::TripleO::NodeTLSCAData
284     properties:
285       server: {get_resource: CephStorage}
286
287   # Hook for site-specific additional pre-deployment config, e.g extra hieradata
288   CephStorageExtraConfigPre:
289     depends_on: CephStorageDeployment
290     type: OS::TripleO::CephStorageExtraConfigPre
291     properties:
292         server: {get_resource: CephStorage}
293
294   # Hook for site-specific additional pre-deployment config,
295   # applying to all nodes, e.g node registration/unregistration
296   NodeExtraConfig:
297     depends_on: [CephStorageExtraConfigPre, NodeTLSCAData]
298     type: OS::TripleO::NodeExtraConfig
299     properties:
300         server: {get_resource: CephStorage}
301
302   UpdateConfig:
303     type: OS::TripleO::Tasks::PackageUpdate
304
305   UpdateDeployment:
306     type: OS::Heat::SoftwareDeployment
307     properties:
308       config: {get_resource: UpdateConfig}
309       server: {get_resource: CephStorage}
310       input_values:
311         update_identifier:
312           get_param: UpdateIdentifier
313
314 outputs:
315   ip_address:
316     description: IP address of the server in the ctlplane network
317     value: {get_attr: [CephStorage, networks, ctlplane, 0]}
318   hostname:
319     description: Hostname of the server
320     value: {get_attr: [CephStorage, name]}
321   hostname_map:
322     description: Mapping of network names to hostnames
323     value:
324       external:
325         list_join:
326         - '.'
327         - - {get_attr: [CephStorage, name]}
328           - external
329           - {get_param: CloudDomain}
330       internal_api:
331         list_join:
332         - '.'
333         - - {get_attr: [CephStorage, name]}
334           - internalapi
335           - {get_param: CloudDomain}
336       storage:
337         list_join:
338         - '.'
339         - - {get_attr: [CephStorage, name]}
340           - storage
341           - {get_param: CloudDomain}
342       storage_mgmt:
343         list_join:
344         - '.'
345         - - {get_attr: [CephStorage, name]}
346           - storagemgmt
347           - {get_param: CloudDomain}
348       tenant:
349         list_join:
350         - '.'
351         - - {get_attr: [CephStorage, name]}
352           - tenant
353           - {get_param: CloudDomain}
354       management:
355         list_join:
356         - '.'
357         - - {get_attr: [CephStorage, name]}
358           - management
359           - {get_param: CloudDomain}
360       ctlplane:
361         list_join:
362         - '.'
363         - - {get_attr: [CephStorage, name]}
364           - ctlplane
365           - {get_param: CloudDomain}
366   hosts_entry:
367     value:
368       str_replace:
369         template: |
370           PRIMARYIP PRIMARYHOST.DOMAIN PRIMARYHOST
371           EXTERNALIP EXTERNALHOST.DOMAIN EXTERNALHOST
372           INTERNAL_APIIP INTERNAL_APIHOST.DOMAIN INTERNAL_APIHOST
373           STORAGEIP STORAGEHOST.DOMAIN STORAGEHOST
374           STORAGE_MGMTIP STORAGE_MGMTHOST.DOMAIN STORAGE_MGMTHOST
375           TENANTIP TENANTHOST.DOMAIN TENANTHOST
376           MANAGEMENTIP MANAGEMENTHOST.DOMAIN MANAGEMENTHOST
377           CTLPLANEIP CTLPLANEHOST.DOMAIN CTLPLANEHOST
378         params:
379           PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, CephStorageHostnameResolveNetwork]}]}
380           DOMAIN: {get_param: CloudDomain}
381           PRIMARYHOST: {get_attr: [CephStorage, name]}
382           EXTERNALIP: {get_attr: [ExternalPort, ip_address]}
383           EXTERNALHOST:
384             list_join:
385             - '.'
386             - - {get_attr: [CephStorage, name]}
387               - external
388           INTERNAL_APIIP: {get_attr: [InternalApiPort, ip_address]}
389           INTERNAL_APIHOST:
390             list_join:
391             - '.'
392             - - {get_attr: [CephStorage, name]}
393               - internalapi
394           STORAGEIP: {get_attr: [StoragePort, ip_address]}
395           STORAGEHOST:
396             list_join:
397             - '.'
398             - - {get_attr: [CephStorage, name]}
399               - storage
400           STORAGE_MGMTIP: {get_attr: [StorageMgmtPort, ip_address]}
401           STORAGE_MGMTHOST:
402             list_join:
403             - '.'
404             - - {get_attr: [CephStorage, name]}
405               - storagemgmt
406           TENANTIP: {get_attr: [TenantPort, ip_address]}
407           TENANTHOST:
408             list_join:
409             - '.'
410             - - {get_attr: [CephStorage, name]}
411               - tenant
412           MANAGEMENTIP: {get_attr: [ManagementPort, ip_address]}
413           MANAGEMENTHOST:
414             list_join:
415             - '.'
416             - - {get_attr: [CephStorage, name]}
417               - management
418           CTLPLANEIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
419           CTLPLANEHOST:
420             list_join:
421             - '.'
422             - - {get_attr: [CephStorage, name]}
423               - ctlplane
424   nova_server_resource:
425     description: Heat resource handle for the ceph storage server
426     value:
427       {get_resource: CephStorage}
428   external_ip_address:
429     description: IP address of the server in the external network
430     value: {get_attr: [ExternalPort, ip_address]}
431   internal_api_ip_address:
432     description: IP address of the server in the internal_api network
433     value: {get_attr: [InternalApiPort, ip_address]}
434   storage_ip_address:
435     description: IP address of the server in the storage network
436     value: {get_attr: [StoragePort, ip_address]}
437   storage_mgmt_ip_address:
438     description: IP address of the server in the storage_mgmt network
439     value: {get_attr: [StorageMgmtPort, ip_address]}
440   tenant_ip_address:
441     description: IP address of the server in the tenant network
442     value: {get_attr: [TenantPort, ip_address]}
443   management_ip_address:
444     description: IP address of the server in the management network
445     value: {get_attr: [ManagementPort, ip_address]}