Merge "Store role_data in an OS::Heat::Value resource"
[apex-tripleo-heat-templates.git] / puppet / services / swift-storage.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Swift Storage service configured with Puppet
5
6 parameters:
7   ServiceNetMap:
8     default: {}
9     description: Mapping of service_name -> network name. Typically set
10                  via parameter_defaults in the resource registry.  This
11                  mapping overrides those in ServiceNetMapDefaults.
12     type: json
13   DefaultPasswords:
14     default: {}
15     type: json
16   RoleName:
17     default: ''
18     description: Role name on which the service is applied
19     type: string
20   RoleParameters:
21     default: {}
22     description: Parameters specific to the role
23     type: json
24   EndpointMap:
25     default: {}
26     description: Mapping of service endpoint -> protocol. Typically set
27                  via parameter_defaults in the resource registry.
28     type: json
29   Debug:
30     default: ''
31     description: Set to True to enable debugging on all services.
32     type: string
33   SwiftMountCheck:
34     default: false
35     description: Value of mount_check in Swift account/container/object -server.conf
36     type: boolean
37   SwiftRawDisks:
38     default: {}
39     description: 'A hash of additional raw devices to use as Swift backend (eg. {sdb: {}})'
40     type: json
41   MonitoringSubscriptionSwiftStorage:
42     default: 'overcloud-swift-storage'
43     type: string
44
45   # DEPRECATED options for compatibility with overcloud.yaml
46   # This should be removed and manipulation of the ControllerServices list
47   # used instead, but we need client support for that first
48   ControllerEnableSwiftStorage:
49     default: true
50     description: Whether to enable Swift Storage on the Controller
51     type: boolean
52
53 parameter_groups:
54 - label: deprecated
55   description: Do not use deprecated params, they will be removed.
56   parameters:
57   - ControllerEnableSwiftStorage
58
59 resources:
60   SwiftBase:
61     type: ./swift-base.yaml
62     properties:
63       ServiceNetMap: {get_param: ServiceNetMap}
64       DefaultPasswords: {get_param: DefaultPasswords}
65       EndpointMap: {get_param: EndpointMap}
66       RoleName: {get_param: RoleName}
67       RoleParameters: {get_param: RoleParameters}
68
69 conditions:
70   swift_mount_check:
71     or:
72     - equals:
73       - get_param: SwiftMountCheck
74       - true
75     - not:
76         equals:
77         - get_param: SwiftRawDisks
78         - {}
79
80 outputs:
81   role_data:
82     description: Role data for the Swift Proxy role.
83     value:
84       service_name: swift_storage
85       monitoring_subscription: {get_param: MonitoringSubscriptionSwiftStorage}
86       config_settings:
87         map_merge:
88           - get_attr: [SwiftBase, role_data, config_settings]
89           - swift::storage::all::mount_check: {if: [swift_mount_check, true, false]}
90             tripleo::profile::base::swift::storage::enable_swift_storage: {get_param: ControllerEnableSwiftStorage}
91             tripleo.swift_storage.firewall_rules:
92               '123 swift storage':
93                 dport:
94                   - 873
95                   - 6000
96                   - 6001
97                   - 6002
98             swift::storage::all::incoming_chmod: 'Du=rwx,g=rx,o=rx,Fu=rw,g=r,o=r'
99             swift::storage::all::outgoing_chmod: 'Du=rwx,g=rx,o=rx,Fu=rw,g=r,o=r'
100             swift::storage::all::object_pipeline:
101               - healthcheck
102               - recon
103               - object-server
104             swift::storage::all::container_pipeline:
105               - healthcheck
106               - container-server
107             swift::storage::all::account_pipeline:
108               - healthcheck
109               - account-server
110             swift::storage::disks::args: {get_param: SwiftRawDisks}
111             swift::storage::all::storage_local_net_ip: {get_param: [ServiceNetMap, SwiftStorageNetwork]}
112       step_config: |
113         include ::tripleo::profile::base::swift::storage
114       upgrade_tasks:
115         - name: Stop swift storage services
116           tags: step1
117           service: name={{ item }} state=stopped
118           with_items:
119             - openstack-swift-account-auditor
120             - openstack-swift-account-reaper
121             - openstack-swift-account-replicator
122             - openstack-swift-account
123             - openstack-swift-container-auditor
124             - openstack-swift-container-replicator
125             - openstack-swift-container-updater
126             - openstack-swift-container
127             - openstack-swift-object-auditor
128             - openstack-swift-object-replicator
129             - openstack-swift-object-updater
130             - openstack-swift-object