Merge "Add NovaVNCProxy back into endpoint_map"
[apex-tripleo-heat-templates.git] / puppet / ceph-storage.yaml
1 heat_template_version: 2015-04-30
2 description: 'OpenStack ceph storage node configured by Puppet'
3 parameters:
4   Flavor:
5     description: Flavor for the Ceph Storage node.
6     type: string
7     constraints:
8       - custom_constraint: nova.flavor
9   Image:
10     type: string
11     default: overcloud-ceph-storage
12     constraints:
13       - custom_constraint: glance.image
14   ImageUpdatePolicy:
15     default: 'REBUILD_PRESERVE_EPHEMERAL'
16     description: What policy to use when reconstructing instances. REBUILD for rebuilds, REBUILD_PRESERVE_EPHEMERAL to preserve /mnt.
17     type: string
18   KeyName:
19     description: Name of an existing Nova key pair to enable SSH access to the instances
20     type: string
21     default: default
22     constraints:
23       - custom_constraint: nova.keypair
24   NtpServer:
25     default: ''
26     description: Comma-separated list of ntp servers
27     type: comma_delimited_list
28   EnablePackageInstall:
29     default: 'false'
30     description: Set to true to enable package installation via Puppet
31     type: boolean
32   ServiceNetMap:
33     default: {}
34     description: Mapping of service_name -> network name. Typically set
35                  via parameter_defaults in the resource registry.
36     type: json
37   TimeZone:
38     default: 'UTC'
39     description: The timezone to be set on Ceph nodes.
40     type: string
41   UpdateIdentifier:
42     default: ''
43     type: string
44     description: >
45       Setting to a previously unused value during stack-update will trigger
46       package update on all nodes
47   Hostname:
48     type: string
49     default: '' # Defaults to Heat created hostname
50   ExtraConfig:
51     default: {}
52     description: |
53       Additional hiera configuration to inject into the cluster. Note
54       that CephStorageExtraConfig takes precedence over ExtraConfig.
55     type: json
56   CephStorageExtraConfig:
57     default: {}
58     description: |
59       Role specific additional hiera configuration to inject into the cluster.
60     type: json
61   NetworkDeploymentActions:
62     type: comma_delimited_list
63     description: >
64       Heat action when to apply network configuration changes
65     default: ['CREATE']
66   SoftwareConfigTransport:
67     default: POLL_SERVER_CFN
68     description: |
69       How the server should receive the metadata required for software configuration.
70     type: string
71     constraints:
72     - allowed_values: [POLL_SERVER_CFN, POLL_SERVER_HEAT, POLL_TEMP_URL, ZAQAR_MESSAGE]
73   CloudDomain:
74     default: ''
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   SchedulerHints:
86     type: json
87     description: Optional scheduler hints to pass to nova
88     default: {}
89
90 resources:
91   CephStorage:
92     type: OS::Nova::Server
93     properties:
94       image: {get_param: Image}
95       image_update_policy: {get_param: ImageUpdatePolicy}
96       flavor: {get_param: Flavor}
97       key_name: {get_param: KeyName}
98       networks:
99         - network: ctlplane
100       user_data_format: SOFTWARE_CONFIG
101       user_data: {get_resource: UserData}
102       name: {get_param: Hostname}
103       software_config_transport: {get_param: SoftwareConfigTransport}
104       metadata: {get_param: ServerMetadata}
105       scheduler_hints: {get_param: SchedulerHints}
106
107   # Combine the NodeAdminUserData and NodeUserData mime archives
108   UserData:
109     type: OS::Heat::MultipartMime
110     properties:
111       parts:
112       - config: {get_resource: NodeAdminUserData}
113         type: multipart
114       - config: {get_resource: NodeUserData}
115         type: multipart
116
117   # Creates the "heat-admin" user if configured via the environment
118   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
119   NodeAdminUserData:
120     type: OS::TripleO::NodeAdminUserData
121
122   # For optional operator additional userdata
123   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
124   NodeUserData:
125     type: OS::TripleO::NodeUserData
126
127   ExternalPort:
128     type: OS::TripleO::CephStorage::Ports::ExternalPort
129     properties:
130       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
131
132   InternalApiPort:
133     type: OS::TripleO::CephStorage::Ports::InternalApiPort
134     properties:
135       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
136
137   StoragePort:
138     type: OS::TripleO::CephStorage::Ports::StoragePort
139     properties:
140       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
141
142   StorageMgmtPort:
143     type: OS::TripleO::CephStorage::Ports::StorageMgmtPort
144     properties:
145       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
146
147   TenantPort:
148     type: OS::TripleO::CephStorage::Ports::TenantPort
149     properties:
150       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
151
152   ManagementPort:
153     type: OS::TripleO::CephStorage::Ports::ManagementPort
154     properties:
155       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
156
157   NetworkConfig:
158     type: OS::TripleO::CephStorage::Net::SoftwareConfig
159     properties:
160       ControlPlaneIp: {get_attr: [CephStorage, networks, ctlplane, 0]}
161       ExternalIpSubnet: {get_attr: [ExternalPort, ip_subnet]}
162       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
163       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
164       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
165       TenantIpSubnet: {get_attr: [TenantPort, ip_subnet]}
166       ManagementIpSubnet: {get_attr: [ManagementPort, ip_subnet]}
167
168   NetIpMap:
169     type: OS::TripleO::Network::Ports::NetIpMap
170     properties:
171       ControlPlaneIp: {get_attr: [CephStorage, networks, ctlplane, 0]}
172       ExternalIp: {get_attr: [ExternalPort, ip_address]}
173       InternalApiIp: {get_attr: [InternalApiPort, ip_address]}
174       StorageIp: {get_attr: [StoragePort, ip_address]}
175       StorageMgmtIp: {get_attr: [StorageMgmtPort, ip_address]}
176       TenantIp: {get_attr: [TenantPort, ip_address]}
177       ManagementIp: {get_attr: [ManagementPort, ip_address]}
178
179   NetIpSubnetMap:
180     type: OS::TripleO::Network::Ports::NetIpSubnetMap
181     properties:
182       ControlPlaneIp: {get_attr: [CephStorage, networks, ctlplane, 0]}
183       ExternalIpSubnet: {get_attr: [ExternalPort, ip_subnet]}
184       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
185       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
186       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
187       TenantIpSubnet: {get_attr: [TenantPort, ip_subnet]}
188       ManagementIpSubnet: {get_attr: [ManagementPort, ip_subnet]}
189
190   NetworkDeployment:
191     type: OS::TripleO::SoftwareDeployment
192     properties:
193       name: NetworkDeployment
194       config: {get_resource: NetworkConfig}
195       server: {get_resource: CephStorage}
196       actions: {get_param: NetworkDeploymentActions}
197
198   CephStorageDeployment:
199     type: OS::Heat::StructuredDeployment
200     depends_on: NetworkDeployment
201     properties:
202       name: CephStorageDeployment
203       config: {get_resource: CephStorageConfig}
204       server: {get_resource: CephStorage}
205       input_values:
206         ntp_servers: {get_param: NtpServer}
207         timezone: {get_param: TimeZone}
208         enable_package_install: {get_param: EnablePackageInstall}
209         enable_package_upgrade: {get_attr: [UpdateDeployment, update_managed_packages]}
210         ceph_cluster_network: {get_attr: [NetIpSubnetMap, net_ip_subnet_map, {get_param: [ServiceNetMap, CephClusterNetwork]}]}
211         ceph_public_network: {get_attr: [NetIpSubnetMap, net_ip_subnet_map, {get_param: [ServiceNetMap, CephPublicNetwork]}]}
212
213   CephStorageConfig:
214     type: OS::Heat::StructuredConfig
215     properties:
216       group: os-apply-config
217       config:
218         hiera:
219           hierarchy:
220             - '"%{::uuid}"'
221             - heat_config_%{::deploy_config_name}
222             - ceph_extraconfig
223             - extraconfig
224             - ceph_cluster # provided by CephClusterConfig
225             - ceph
226             - '"%{::osfamily}"'
227             - common
228           datafiles:
229             common:
230               raw_data: {get_file: hieradata/common.yaml}
231             ceph_extraconfig:
232               mapped_data: {get_param: CephStorageExtraConfig}
233             extraconfig:
234               mapped_data: {get_param: ExtraConfig}
235             ceph:
236               raw_data: {get_file: hieradata/ceph.yaml}
237               mapped_data:
238                 ntp::servers: {get_input: ntp_servers}
239                 timezone::timezone: {get_input: timezone}
240                 tripleo::packages::enable_install: {get_input: enable_package_install}
241                 tripleo::packages::enable_upgrade: {get_input: enable_package_upgrade}
242                 ceph::profile::params::cluster_network: {get_input: ceph_cluster_network}
243                 ceph::profile::params::public_network: {get_input: ceph_public_network}
244
245   # Resource for site-specific injection of root certificate
246   NodeTLSCAData:
247     depends_on: CephStorageDeployment
248     type: OS::TripleO::NodeTLSCAData
249     properties:
250       server: {get_resource: CephStorage}
251
252   # Hook for site-specific additional pre-deployment config, e.g extra hieradata
253   CephStorageExtraConfigPre:
254     depends_on: CephStorageDeployment
255     type: OS::TripleO::CephStorageExtraConfigPre
256     properties:
257         server: {get_resource: CephStorage}
258
259   # Hook for site-specific additional pre-deployment config,
260   # applying to all nodes, e.g node registration/unregistration
261   NodeExtraConfig:
262     depends_on: [CephStorageExtraConfigPre, NodeTLSCAData]
263     type: OS::TripleO::NodeExtraConfig
264     properties:
265         server: {get_resource: CephStorage}
266
267   UpdateConfig:
268     type: OS::TripleO::Tasks::PackageUpdate
269
270   UpdateDeployment:
271     type: OS::Heat::SoftwareDeployment
272     properties:
273       config: {get_resource: UpdateConfig}
274       server: {get_resource: CephStorage}
275       input_values:
276         update_identifier:
277           get_param: UpdateIdentifier
278
279 outputs:
280   hosts_entry:
281     value:
282       str_replace:
283         template: |
284           PRIMARYIP PRIMARYHOST.DOMAIN PRIMARYHOST
285           EXTERNALIP EXTERNALHOST
286           INTERNAL_APIIP INTERNAL_APIHOST
287           STORAGEIP STORAGEHOST
288           STORAGE_MGMTIP STORAGE_MGMTHOST
289           TENANTIP TENANTHOST
290           MANAGEMENTIP MANAGEMENTHOST
291         params:
292           PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, CephStorageHostnameResolveNetwork]}]}
293           DOMAIN: {get_param: CloudDomain}
294           PRIMARYHOST: {get_attr: [CephStorage, name]}
295           EXTERNALIP: {get_attr: [ExternalPort, ip_address]}
296           EXTERNALHOST:
297             list_join:
298             - '-'
299             - - {get_attr: [CephStorage, name]}
300               - external
301           INTERNAL_APIIP: {get_attr: [InternalApiPort, ip_address]}
302           INTERNAL_APIHOST:
303             list_join:
304             - '-'
305             - - {get_attr: [CephStorage, name]}
306               - internalapi
307           STORAGEIP: {get_attr: [StoragePort, ip_address]}
308           STORAGEHOST:
309             list_join:
310             - '-'
311             - - {get_attr: [CephStorage, name]}
312               - storage
313           STORAGE_MGMTIP: {get_attr: [StorageMgmtPort, ip_address]}
314           STORAGE_MGMTHOST:
315             list_join:
316             - '-'
317             - - {get_attr: [CephStorage, name]}
318               - storagemgmt
319           TENANTIP: {get_attr: [TenantPort, ip_address]}
320           TENANTHOST:
321             list_join:
322             - '-'
323             - - {get_attr: [CephStorage, name]}
324               - tenant
325           MANAGEMENTIP: {get_attr: [ManagementPort, ip_address]}
326           MANAGEMENTHOST:
327             list_join:
328             - '-'
329             - - {get_attr: [CephStorage, name]}
330               - management
331   nova_server_resource:
332     description: Heat resource handle for the ceph storage server
333     value:
334       {get_resource: CephStorage}
335   external_ip_address:
336     description: IP address of the server in the external network
337     value: {get_attr: [ExternalPort, ip_address]}
338   internal_api_ip_address:
339     description: IP address of the server in the internal_api network
340     value: {get_attr: [InternalApiPort, ip_address]}
341   storage_ip_address:
342     description: IP address of the server in the storage network
343     value: {get_attr: [StoragePort, ip_address]}
344   storage_mgmt_ip_address:
345     description: IP address of the server in the storage_mgmt network
346     value: {get_attr: [StorageMgmtPort, ip_address]}
347   tenant_ip_address:
348     description: IP address of the server in the tenant network
349     value: {get_attr: [TenantPort, ip_address]}
350   management_ip_address:
351     description: IP address of the server in the management network
352     value: {get_attr: [ManagementPort, ip_address]}
353   config_identifier:
354     description: identifier which changes if the node configuration may need re-applying
355     value:
356       list_join:
357       - ','
358       - - {get_attr: [CephStorageDeployment, deploy_stdout]}
359         - {get_attr: [NodeTLSCAData, deploy_stdout]}
360         - {get_attr: [CephStorageExtraConfigPre, deploy_stdout]}
361         - {get_param: UpdateIdentifier}