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