Fix ceilometer auth url
[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   RingBuild:
34     default: true
35     description: Whether to manage Swift rings or not
36     type: boolean
37   Replicas:
38     type: number
39     default: 3
40     description: How many replicas to use in the swift rings.
41   SnmpdReadonlyUserName:
42     default: ro_snmp_user
43     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
44     type: string
45   SnmpdReadonlyUserPassword:
46     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
47     type: string
48     hidden: true
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   ServiceConfigSettings:
121     type: json
122     default: {}
123
124 resources:
125
126   SwiftStorage:
127     type: OS::Nova::Server
128     properties:
129       image: {get_param: Image}
130       flavor: {get_param: Flavor}
131       key_name: {get_param: KeyName}
132       networks:
133         - network: ctlplane
134       user_data_format: SOFTWARE_CONFIG
135       user_data: {get_resource: UserData}
136       name:
137         str_replace:
138             template: {get_param: Hostname}
139             params: {get_param: HostnameMap}
140       software_config_transport: {get_param: SoftwareConfigTransport}
141       metadata: {get_param: ServerMetadata}
142       scheduler_hints: {get_param: SchedulerHints}
143
144   # Combine the NodeAdminUserData and NodeUserData mime archives
145   UserData:
146     type: OS::Heat::MultipartMime
147     properties:
148       parts:
149       - config: {get_resource: NodeAdminUserData}
150         type: multipart
151       - config: {get_resource: NodeUserData}
152         type: multipart
153
154   # Creates the "heat-admin" user if configured via the environment
155   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
156   NodeAdminUserData:
157     type: OS::TripleO::NodeAdminUserData
158
159   # For optional operator additional userdata
160   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
161   NodeUserData:
162     type: OS::TripleO::NodeUserData
163
164   ExternalPort:
165     type: OS::TripleO::SwiftStorage::Ports::ExternalPort
166     properties:
167       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
168       IPPool: {get_param: SwiftStorageIPs}
169       NodeIndex: {get_param: NodeIndex}
170
171   InternalApiPort:
172     type: OS::TripleO::SwiftStorage::Ports::InternalApiPort
173     properties:
174       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
175       IPPool: {get_param: SwiftStorageIPs}
176       NodeIndex: {get_param: NodeIndex}
177
178   StoragePort:
179     type: OS::TripleO::SwiftStorage::Ports::StoragePort
180     properties:
181       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
182       IPPool: {get_param: SwiftStorageIPs}
183       NodeIndex: {get_param: NodeIndex}
184
185   StorageMgmtPort:
186     type: OS::TripleO::SwiftStorage::Ports::StorageMgmtPort
187     properties:
188       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
189       IPPool: {get_param: SwiftStorageIPs}
190       NodeIndex: {get_param: NodeIndex}
191
192   TenantPort:
193     type: OS::TripleO::SwiftStorage::Ports::TenantPort
194     properties:
195       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
196       IPPool: {get_param: SwiftStorageIPs}
197       NodeIndex: {get_param: NodeIndex}
198
199   ManagementPort:
200     type: OS::TripleO::SwiftStorage::Ports::ManagementPort
201     properties:
202       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
203       IPPool: {get_param: SwiftStorageIPs}
204       NodeIndex: {get_param: NodeIndex}
205
206   NetworkConfig:
207     type: OS::TripleO::ObjectStorage::Net::SoftwareConfig
208     properties:
209       ControlPlaneIp: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
210       ExternalIpSubnet: {get_attr: [ExternalPort, ip_subnet]}
211       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
212       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
213       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
214       TenantIpSubnet: {get_attr: [TenantPort, ip_subnet]}
215       ManagementIpSubnet: {get_attr: [ManagementPort, ip_subnet]}
216
217   NetIpMap:
218     type: OS::TripleO::Network::Ports::NetIpMap
219     properties:
220       ControlPlaneIp: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
221       ExternalIp: {get_attr: [ExternalPort, ip_address]}
222       ExternalIpSubnet: {get_attr: [ExternalPort, ip_subnet]}
223       ExternalIpUri: {get_attr: [ExternalPort, ip_address_uri]}
224       InternalApiIp: {get_attr: [InternalApiPort, ip_address]}
225       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
226       InternalApiIpUri: {get_attr: [InternalApiPort, ip_address_uri]}
227       StorageIp: {get_attr: [StoragePort, ip_address]}
228       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
229       StorageIpUri: {get_attr: [StoragePort, ip_address_uri]}
230       StorageMgmtIp: {get_attr: [StorageMgmtPort, ip_address]}
231       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
232       StorageMgmtIpUri: {get_attr: [StorageMgmtPort, ip_address_uri]}
233       TenantIp: {get_attr: [TenantPort, ip_address]}
234       TenantIpSubnet: {get_attr: [TenantPort, ip_subnet]}
235       TenantIpUri: {get_attr: [TenantPort, ip_address_uri]}
236       ManagementIp: {get_attr: [ManagementPort, ip_address]}
237       ManagementIpSubnet: {get_attr: [ManagementPort, ip_subnet]}
238       ManagementIpUri: {get_attr: [ManagementPort, ip_address_uri]}
239
240   NetworkDeployment:
241     type: OS::TripleO::SoftwareDeployment
242     properties:
243       name: NetworkDeployment
244       config: {get_resource: NetworkConfig}
245       server: {get_resource: SwiftStorage}
246       actions: {get_param: NetworkDeploymentActions}
247
248   SwiftStorageHieraConfig:
249     type: OS::Heat::StructuredConfig
250     properties:
251       group: os-apply-config
252       config:
253         hiera:
254           hierarchy:
255             - '"%{::uuid}"'
256             - heat_config_%{::deploy_config_name}
257             - object_extraconfig
258             - extraconfig
259             - service_configs
260             - object
261             - swift_devices_and_proxy # provided by SwiftDevicesAndProxyConfig
262             - all_nodes # provided by allNodesConfig
263             - '"%{::osfamily}"'
264             - common
265             - network
266           merge_behavior: deeper
267           datafiles:
268             service_configs:
269               mapped_data: {get_param: ServiceConfigSettings}
270             common:
271               raw_data: {get_file: hieradata/common.yaml}
272             network:
273               mapped_data:
274                 net_ip_map: {get_attr: [NetIpMap, net_ip_map]}
275                 net_ip_subnet_map: {get_attr: [NetIpMap, net_ip_subnet_map]}
276                 net_ip_uri_map: {get_attr: [NetIpMap, net_ip_uri_map]}
277             object_extraconfig:
278               mapped_data: {get_param: ObjectStorageExtraConfig}
279             extraconfig:
280               mapped_data: {get_param: ExtraConfig}
281             object:
282               raw_data: {get_file: hieradata/object.yaml}
283               mapped_data: # data supplied directly to this deployment configuration, etc
284                 swift::swift_hash_path_suffix: { get_input: swift_hash_suffix }
285                 tripleo::ringbuilder::build_ring: { get_input: swift_ring_build }
286                 tripleo::ringbuilder::part_power: { get_input: swift_part_power }
287                 tripleo::ringbuilder::replicas: {get_input: swift_replicas }
288                 swift::storage::all::storage_local_net_ip: {get_input: swift_management_network}
289                 swift_mount_check: {get_input: swift_mount_check }
290                 tripleo::ringbuilder::min_part_hours: { get_input: swift_min_part_hours }
291                 timezone::timezone: {get_input: timezone}
292                 snmpd_readonly_user_name: {get_input: snmpd_readonly_user_name}
293                 snmpd_readonly_user_password: {get_input: snmpd_readonly_user_password}
294                 tripleo::packages::enable_install: {get_input: enable_package_install}
295                 tripleo::packages::enable_upgrade: {get_input: enable_package_upgrade}
296
297
298   SwiftStorageHieraDeploy:
299     type: OS::Heat::StructuredDeployment
300     depends_on: NetworkDeployment
301     properties:
302       name: SwiftStorageHieraDeploy
303       server: {get_resource: SwiftStorage}
304       config: {get_resource: SwiftStorageHieraConfig}
305       input_values:
306         local_ip: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
307         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
308         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
309         swift_hash_suffix: {get_param: HashSuffix}
310         swift_mount_check: {get_param: MountCheck}
311         swift_min_part_hours: {get_param: MinPartHours}
312         swift_ring_build: {get_param: RingBuild}
313         swift_part_power: {get_param: PartPower}
314         swift_replicas: { get_param: Replicas}
315         timezone: {get_param: TimeZone}
316         enable_package_install: {get_param: EnablePackageInstall}
317         enable_package_upgrade: {get_attr: [UpdateDeployment, update_managed_packages]}
318         swift_management_network: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, SwiftMgmtNetwork]}]}
319
320   # Resource for site-specific injection of root certificate
321   NodeTLSCAData:
322     depends_on: SwiftStorageHieraDeploy
323     type: OS::TripleO::NodeTLSCAData
324     properties:
325       server: {get_resource: SwiftStorage}
326
327   # Hook for site-specific additional pre-deployment config,
328   # applying to all nodes, e.g node registration/unregistration
329   NodeExtraConfig:
330     depends_on: NodeTLSCAData
331     type: OS::TripleO::NodeExtraConfig
332     properties:
333         server: {get_resource: SwiftStorage}
334
335   UpdateConfig:
336     type: OS::TripleO::Tasks::PackageUpdate
337
338   UpdateDeployment:
339     type: OS::Heat::SoftwareDeployment
340     properties:
341       config: {get_resource: UpdateConfig}
342       server: {get_resource: SwiftStorage}
343       input_values:
344         update_identifier:
345           get_param: UpdateIdentifier
346
347 outputs:
348   hosts_entry:
349     value:
350       str_replace:
351         template: |
352           PRIMARYIP PRIMARYHOST.DOMAIN PRIMARYHOST
353           EXTERNALIP EXTERNALHOST.DOMAIN EXTERNALHOST
354           INTERNAL_APIIP INTERNAL_APIHOST.DOMAIN INTERNAL_APIHOST
355           STORAGEIP STORAGEHOST.DOMAIN STORAGEHOST
356           STORAGE_MGMTIP STORAGE_MGMTHOST.DOMAIN STORAGE_MGMTHOST
357           TENANTIP TENANTHOST.DOMAIN TENANTHOST
358           MANAGEMENTIP MANAGEMENTHOST.DOMAIN MANAGEMENTHOST
359         params:
360           PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, ObjectStorageHostnameResolveNetwork]}]}
361           DOMAIN: {get_param: CloudDomain}
362           PRIMARYHOST: {get_attr: [SwiftStorage, name]}
363           EXTERNALIP: {get_attr: [ExternalPort, ip_address]}
364           EXTERNALHOST:
365             list_join:
366             - '.'
367             - - {get_attr: [SwiftStorage, name]}
368               - external
369           INTERNAL_APIIP: {get_attr: [InternalApiPort, ip_address]}
370           INTERNAL_APIHOST:
371             list_join:
372             - '.'
373             - - {get_attr: [SwiftStorage, name]}
374               - internalapi
375           STORAGEIP: {get_attr: [StoragePort, ip_address]}
376           STORAGEHOST:
377             list_join:
378             - '.'
379             - - {get_attr: [SwiftStorage, name]}
380               - storage
381           STORAGE_MGMTIP: {get_attr: [StorageMgmtPort, ip_address]}
382           STORAGE_MGMTHOST:
383             list_join:
384             - '.'
385             - - {get_attr: [SwiftStorage, name]}
386               - storagemgmt
387           TENANTIP: {get_attr: [TenantPort, ip_address]}
388           TENANTHOST:
389             list_join:
390             - '.'
391             - - {get_attr: [SwiftStorage, name]}
392               - tenant
393           MANAGEMENTIP: {get_attr: [ManagementPort, ip_address]}
394           MANAGEMENTHOST:
395             list_join:
396             - '.'
397             - - {get_attr: [SwiftStorage, name]}
398               - management
399   nova_server_resource:
400     description: Heat resource handle for the swift storage server
401     value:
402       {get_resource: SwiftStorage}
403   swift_device:
404     description: Swift device formatted for swift-ring-builder
405     value:
406       str_replace:
407         template: 'r1z1-IP:%PORT%/d1'
408         params:
409           IP: {get_attr: [NetIpMap, net_ip_uri_map, {get_param: [ServiceNetMap, SwiftMgmtNetwork]}]}
410   external_ip_address:
411     description: IP address of the server in the external network
412     value: {get_attr: [ExternalPort, ip_address]}
413   internal_api_ip_address:
414     description: IP address of the server in the internal_api network
415     value: {get_attr: [InternalApiPort, ip_address]}
416   storage_ip_address:
417     description: IP address of the server in the storage network
418     value: {get_attr: [StoragePort, ip_address]}
419   storage_mgmt_ip_address:
420     description: IP address of the server in the storage_mgmt network
421     value: {get_attr: [StorageMgmtPort, ip_address]}
422   tenant_ip_address:
423     description: IP address of the server in the tenant network
424     value: {get_attr: [TenantPort, ip_address]}
425   management_ip_address:
426     description: IP address of the server in the management network
427     value: {get_attr: [ManagementPort, ip_address]}
428   config_identifier:
429     description: identifier which changes if the node configuration may need re-applying
430     value:
431       list_join:
432         - ','
433         - - {get_attr: [SwiftStorageHieraDeploy, deploy_stdout]}
434           - {get_attr: [NodeTLSCAData, deploy_stdout]}
435           - {get_param: UpdateIdentifier}