Remove default for the RabbitMQ password
[apex-tripleo-heat-templates.git] / puppet / swift-storage.yaml
1 heat_template_version: 2015-04-30
2 description: 'OpenStack swift storage node configured by Puppet'
3 parameters:
4   Flavor:
5     description: Flavor for Swift storage nodes to request when deploying.
6     type: string
7     constraints:
8       - custom_constraint: nova.flavor
9   HashSuffix:
10     description: A random string to be used as a salt when hashing to determine mappings
11       in the ring.
12     hidden: true
13     type: string
14   Image:
15     default: overcloud-swift-storage
16     type: string
17   KeyName:
18     default: default
19     description: Name of an existing Nova key pair to enable SSH access to the instances
20     type: string
21   MountCheck:
22     default: 'false'
23     description: Value of mount_check in Swift account/container/object -server.conf
24     type: boolean
25   MinPartHours:
26     type: number
27     default: 1
28     description: The minimum time (in hours) before a partition in a ring can be moved following a rebalance.
29   PartPower:
30     default: 10
31     description: Partition Power to use when building Swift rings
32     type: number
33   Replicas:
34     type: number
35     default: 3
36     description: How many replicas to use in the swift rings.
37   SnmpdReadonlyUserName:
38     default: ro_snmp_user
39     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
40     type: string
41   SnmpdReadonlyUserPassword:
42     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
43     type: string
44     hidden: true
45   NtpServer:
46     default: ''
47     description: Comma-separated list of ntp servers
48     type: comma_delimited_list
49   EnablePackageInstall:
50     default: 'false'
51     description: Set to true to enable package installation via Puppet
52     type: boolean
53   UpdateIdentifier:
54     default: ''
55     type: string
56     description: >
57       Setting to a previously unused value during stack-update will trigger
58       package update on all nodes
59   ServiceNetMap:
60     default: {}
61     description: Mapping of service_name -> network name. Typically set
62                  via parameter_defaults in the resource registry.
63     type: json
64   TimeZone:
65     default: 'UTC'
66     description: The timezone to be set on Ceph nodes.
67     type: string
68   Hostname:
69     type: string
70     default: '' # Defaults to Heat created hostname
71   HostnameMap:
72     type: json
73     default: {}
74     description: Optional mapping to override hostnames
75   ExtraConfig:
76     default: {}
77     description: |
78       Additional hiera configuration to inject into the cluster. Note
79       that ObjectStorageExtraConfig takes precedence over ExtraConfig.
80     type: json
81   ObjectStorageExtraConfig:
82     default: {}
83     description: |
84       Role specific additional hiera configuration to inject into the cluster.
85     type: json
86   SwiftStorageIPs:
87     default: {}
88     type: json
89   NetworkDeploymentActions:
90     type: comma_delimited_list
91     description: >
92       Heat action when to apply network configuration changes
93     default: ['CREATE']
94   SoftwareConfigTransport:
95     default: POLL_SERVER_CFN
96     description: |
97       How the server should receive the metadata required for software configuration.
98     type: string
99     constraints:
100     - allowed_values: [POLL_SERVER_CFN, POLL_SERVER_HEAT, POLL_TEMP_URL, ZAQAR_MESSAGE]
101   CloudDomain:
102     default: ''
103     type: string
104     description: >
105       The DNS domain used for the hosts. This should match the dhcp_domain
106       configured in the Undercloud neutron. Defaults to localdomain.
107   ServerMetadata:
108     default: {}
109     description: >
110       Extra properties or metadata passed to Nova for the created nodes in
111       the overcloud. It's accessible via the Nova metadata API.
112     type: json
113   SchedulerHints:
114     type: json
115     description: Optional scheduler hints to pass to nova
116     default: {}
117   NodeIndex:
118     type: number
119     default: 0
120
121 resources:
122
123   SwiftStorage:
124     type: OS::Nova::Server
125     properties:
126       image: {get_param: Image}
127       flavor: {get_param: Flavor}
128       key_name: {get_param: KeyName}
129       networks:
130         - network: ctlplane
131       user_data_format: SOFTWARE_CONFIG
132       user_data: {get_resource: UserData}
133       name:
134         str_replace:
135             template: {get_param: Hostname}
136             params: {get_param: HostnameMap}
137       software_config_transport: {get_param: SoftwareConfigTransport}
138       metadata: {get_param: ServerMetadata}
139       scheduler_hints: {get_param: SchedulerHints}
140
141   # Combine the NodeAdminUserData and NodeUserData mime archives
142   UserData:
143     type: OS::Heat::MultipartMime
144     properties:
145       parts:
146       - config: {get_resource: NodeAdminUserData}
147         type: multipart
148       - config: {get_resource: NodeUserData}
149         type: multipart
150
151   # Creates the "heat-admin" user if configured via the environment
152   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
153   NodeAdminUserData:
154     type: OS::TripleO::NodeAdminUserData
155
156   # For optional operator additional userdata
157   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
158   NodeUserData:
159     type: OS::TripleO::NodeUserData
160
161   ExternalPort:
162     type: OS::TripleO::SwiftStorage::Ports::ExternalPort
163     properties:
164       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
165       IPPool: {get_param: SwiftStorageIPs}
166       NodeIndex: {get_param: NodeIndex}
167
168   InternalApiPort:
169     type: OS::TripleO::SwiftStorage::Ports::InternalApiPort
170     properties:
171       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
172       IPPool: {get_param: SwiftStorageIPs}
173       NodeIndex: {get_param: NodeIndex}
174
175   StoragePort:
176     type: OS::TripleO::SwiftStorage::Ports::StoragePort
177     properties:
178       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
179       IPPool: {get_param: SwiftStorageIPs}
180       NodeIndex: {get_param: NodeIndex}
181
182   StorageMgmtPort:
183     type: OS::TripleO::SwiftStorage::Ports::StorageMgmtPort
184     properties:
185       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
186       IPPool: {get_param: SwiftStorageIPs}
187       NodeIndex: {get_param: NodeIndex}
188
189   TenantPort:
190     type: OS::TripleO::SwiftStorage::Ports::TenantPort
191     properties:
192       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
193       IPPool: {get_param: SwiftStorageIPs}
194       NodeIndex: {get_param: NodeIndex}
195
196   ManagementPort:
197     type: OS::TripleO::SwiftStorage::Ports::ManagementPort
198     properties:
199       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
200       IPPool: {get_param: SwiftStorageIPs}
201       NodeIndex: {get_param: NodeIndex}
202
203   NetworkConfig:
204     type: OS::TripleO::ObjectStorage::Net::SoftwareConfig
205     properties:
206       ControlPlaneIp: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
207       ExternalIpSubnet: {get_attr: [ExternalPort, ip_subnet]}
208       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
209       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
210       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
211       TenantIpSubnet: {get_attr: [TenantPort, ip_subnet]}
212       ManagementIpSubnet: {get_attr: [ManagementPort, ip_subnet]}
213
214   NetIpMap:
215     type: OS::TripleO::Network::Ports::NetIpMap
216     properties:
217       ControlPlaneIp: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
218       ExternalIp: {get_attr: [ExternalPort, ip_address]}
219       ExternalIpUri: {get_attr: [ExternalPort, ip_address_uri]}
220       InternalApiIp: {get_attr: [InternalApiPort, ip_address]}
221       InternalApiIpUri: {get_attr: [InternalApiPort, ip_address_uri]}
222       StorageIp: {get_attr: [StoragePort, ip_address]}
223       StorageIpUri: {get_attr: [StoragePort, ip_address_uri]}
224       StorageMgmtIp: {get_attr: [StorageMgmtPort, ip_address]}
225       StorageMgmtIpUri: {get_attr: [StorageMgmtPort, ip_address_uri]}
226       TenantIp: {get_attr: [TenantPort, ip_address]}
227       TenantIpUri: {get_attr: [TenantPort, ip_address_uri]}
228       ManagementIp: {get_attr: [ManagementPort, ip_address]}
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: SwiftStorage}
237       actions: {get_param: NetworkDeploymentActions}
238
239   SwiftStorageHieraConfig:
240     type: OS::Heat::StructuredConfig
241     properties:
242       group: os-apply-config
243       config:
244         hiera:
245           hierarchy:
246             - '"%{::uuid}"'
247             - heat_config_%{::deploy_config_name}
248             - object_extraconfig
249             - extraconfig
250             - object
251             - swift_devices_and_proxy # provided by SwiftDevicesAndProxyConfig
252             - all_nodes # provided by allNodesConfig
253             - '"%{::osfamily}"'
254             - common
255           datafiles:
256             common:
257               raw_data: {get_file: hieradata/common.yaml}
258             object_extraconfig:
259               mapped_data: {get_param: ObjectStorageExtraConfig}
260             extraconfig:
261               mapped_data: {get_param: ExtraConfig}
262             object:
263               raw_data: {get_file: hieradata/object.yaml}
264               mapped_data: # data supplied directly to this deployment configuration, etc
265                 swift::swift_hash_suffix: { get_input: swift_hash_suffix }
266                 tripleo::ringbuilder::part_power: { get_input: swift_part_power }
267                 tripleo::ringbuilder::replicas: {get_input: swift_replicas }
268                 # Swift
269                 swift::storage::all::storage_local_net_ip: {get_input: swift_management_network}
270                 swift_mount_check: {get_input: swift_mount_check }
271                 tripleo::ringbuilder::min_part_hours: { get_input: swift_min_part_hours }
272                 ntp::servers: {get_input: ntp_servers}
273                 timezone::timezone: {get_input: timezone}
274                 # NOTE(dprince): build_ring support is currently not wired in.
275                 # See: https://review.openstack.org/#/c/109225/
276                 tripleo::ringbuilder::build_ring: True
277                 snmpd_readonly_user_name: {get_input: snmpd_readonly_user_name}
278                 snmpd_readonly_user_password: {get_input: snmpd_readonly_user_password}
279                 tripleo::packages::enable_install: {get_input: enable_package_install}
280                 tripleo::packages::enable_upgrade: {get_input: enable_package_upgrade}
281
282
283   SwiftStorageHieraDeploy:
284     type: OS::Heat::StructuredDeployment
285     depends_on: NetworkDeployment
286     properties:
287       name: SwiftStorageHieraDeploy
288       server: {get_resource: SwiftStorage}
289       config: {get_resource: SwiftStorageHieraConfig}
290       input_values:
291         local_ip: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
292         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
293         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
294         swift_hash_suffix: {get_param: HashSuffix}
295         swift_mount_check: {get_param: MountCheck}
296         swift_min_part_hours: {get_param: MinPartHours}
297         swift_part_power: {get_param: PartPower}
298         swift_replicas: { get_param: Replicas}
299         ntp_servers: {get_param: NtpServer}
300         timezone: {get_param: TimeZone}
301         enable_package_install: {get_param: EnablePackageInstall}
302         enable_package_upgrade: {get_attr: [UpdateDeployment, update_managed_packages]}
303         swift_management_network: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, SwiftMgmtNetwork]}]}
304
305   # Resource for site-specific injection of root certificate
306   NodeTLSCAData:
307     depends_on: SwiftStorageHieraDeploy
308     type: OS::TripleO::NodeTLSCAData
309     properties:
310       server: {get_resource: SwiftStorage}
311
312   # Hook for site-specific additional pre-deployment config,
313   # applying to all nodes, e.g node registration/unregistration
314   NodeExtraConfig:
315     depends_on: NodeTLSCAData
316     type: OS::TripleO::NodeExtraConfig
317     properties:
318         server: {get_resource: SwiftStorage}
319
320   UpdateConfig:
321     type: OS::TripleO::Tasks::PackageUpdate
322
323   UpdateDeployment:
324     type: OS::Heat::SoftwareDeployment
325     properties:
326       config: {get_resource: UpdateConfig}
327       server: {get_resource: SwiftStorage}
328       input_values:
329         update_identifier:
330           get_param: UpdateIdentifier
331
332 outputs:
333   hosts_entry:
334     value:
335       str_replace:
336         template: |
337           PRIMARYIP PRIMARYHOST.DOMAIN PRIMARYHOST
338           EXTERNALIP EXTERNALHOST
339           INTERNAL_APIIP INTERNAL_APIHOST
340           STORAGEIP STORAGEHOST
341           STORAGE_MGMTIP STORAGE_MGMTHOST
342           TENANTIP TENANTHOST
343           MANAGEMENTIP MANAGEMENTHOST
344         params:
345           PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, ObjectStorageHostnameResolveNetwork]}]}
346           DOMAIN: {get_param: CloudDomain}
347           PRIMARYHOST: {get_attr: [SwiftStorage, name]}
348           EXTERNALIP: {get_attr: [ExternalPort, ip_address]}
349           EXTERNALHOST:
350             list_join:
351             - '-'
352             - - {get_attr: [SwiftStorage, name]}
353               - external
354           INTERNAL_APIIP: {get_attr: [InternalApiPort, ip_address]}
355           INTERNAL_APIHOST:
356             list_join:
357             - '-'
358             - - {get_attr: [SwiftStorage, name]}
359               - internalapi
360           STORAGEIP: {get_attr: [StoragePort, ip_address]}
361           STORAGEHOST:
362             list_join:
363             - '-'
364             - - {get_attr: [SwiftStorage, name]}
365               - storage
366           STORAGE_MGMTIP: {get_attr: [StorageMgmtPort, ip_address]}
367           STORAGE_MGMTHOST:
368             list_join:
369             - '-'
370             - - {get_attr: [SwiftStorage, name]}
371               - storagemgmt
372           TENANTIP: {get_attr: [TenantPort, ip_address]}
373           TENANTHOST:
374             list_join:
375             - '-'
376             - - {get_attr: [SwiftStorage, name]}
377               - tenant
378           MANAGEMENTIP: {get_attr: [ManagementPort, ip_address]}
379           MANAGEMENTHOST:
380             list_join:
381             - '-'
382             - - {get_attr: [SwiftStorage, name]}
383               - management
384   nova_server_resource:
385     description: Heat resource handle for the swift storage server
386     value:
387       {get_resource: SwiftStorage}
388   swift_device:
389     description: Swift device formatted for swift-ring-builder
390     value:
391       str_replace:
392         template: 'r1z1-IP:%PORT%/d1'
393         params:
394           IP: {get_attr: [NetIpMap, net_ip_uri_map, {get_param: [ServiceNetMap, SwiftMgmtNetwork]}]}
395   external_ip_address:
396     description: IP address of the server in the external network
397     value: {get_attr: [ExternalPort, ip_address]}
398   internal_api_ip_address:
399     description: IP address of the server in the internal_api network
400     value: {get_attr: [InternalApiPort, ip_address]}
401   storage_ip_address:
402     description: IP address of the server in the storage network
403     value: {get_attr: [StoragePort, ip_address]}
404   storage_mgmt_ip_address:
405     description: IP address of the server in the storage_mgmt network
406     value: {get_attr: [StorageMgmtPort, ip_address]}
407   tenant_ip_address:
408     description: IP address of the server in the tenant network
409     value: {get_attr: [TenantPort, ip_address]}
410   management_ip_address:
411     description: IP address of the server in the management network
412     value: {get_attr: [ManagementPort, ip_address]}
413   config_identifier:
414     description: identifier which changes if the node configuration may need re-applying
415     value:
416       list_join:
417         - ','
418         - - {get_attr: [SwiftStorageHieraDeploy, deploy_stdout]}
419           - {get_attr: [NodeTLSCAData, deploy_stdout]}
420           - {get_param: UpdateIdentifier}