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