Merge "Remove the openvswitch special case upgrade code"
[apex-tripleo-heat-templates.git] / docker / services / swift-storage.yaml
1 heat_template_version: ocata
2
3 description: >
4   OpenStack containerized Swift Storage services.
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerSwiftProxyImage:
12     description: image
13     default: 'centos-binary-swift-proxy-server:latest'
14     type: string
15   DockerSwiftAccountImage:
16     description: image
17     default: 'centos-binary-swift-account:latest'
18     type: string
19   DockerSwiftContainerImage:
20     description: image
21     default: 'centos-binary-swift-container:latest'
22     type: string
23   DockerSwiftObjectImage:
24     description: image
25     default: 'centos-binary-swift-object:latest'
26     type: string
27   EndpointMap:
28     default: {}
29     description: Mapping of service endpoint -> protocol. Typically set
30                  via parameter_defaults in the resource registry.
31     type: json
32   DefaultPasswords:
33     default: {}
34     type: json
35   ServiceNetMap:
36     default: {}
37     description: Mapping of service_name -> network name. Typically set
38                  via parameter_defaults in the resource registry.  This
39                  mapping overrides those in ServiceNetMapDefaults.
40     type: json
41
42 resources:
43
44   SwiftStorageBase:
45     type: ../../puppet/services/swift-storage.yaml
46     properties:
47       EndpointMap: {get_param: EndpointMap}
48       ServiceNetMap: {get_param: ServiceNetMap}
49       DefaultPasswords: {get_param: DefaultPasswords}
50
51 outputs:
52   role_data:
53     description: Role data for the swift storage services.
54     value:
55       service_name: {get_attr: [SwiftStorageBase, role_data, service_name]}
56       config_settings: {get_attr: [SwiftStorageBase, role_data, config_settings]}
57       step_config: &step_config
58         get_attr: [SwiftStorageBase, role_data, step_config]
59       service_config_settings: {get_attr: [SwiftStorageBase, role_data, service_config_settings]}
60       # BEGIN DOCKER SETTINGS
61       docker_image: &swift_proxy_image
62         list_join:
63           - '/'
64           - [ {get_param: DockerNamespace}, {get_param: DockerSwiftProxyImage} ]
65       puppet_config:
66         config_volume: swift
67         puppet_tags: swift_config,swift_container_config,swift_container_sync_realms_config,swift_account_config,swift_object_config,swift_object_expirer_config
68         step_config: *step_config
69         config_image: *swift_proxy_image
70       kolla_config:
71         /var/lib/kolla/config_files/swift_account_auditor.json:
72           command: /usr/bin/swift-account-auditor /etc/swift/account-server.conf
73         /var/lib/kolla/config_files/swift_account_reaper.json:
74           command: /usr/bin/swift-account-reaper /etc/swift/account-server.conf
75         /var/lib/kolla/config_files/swift_account_replicator.json:
76           command: /usr/bin/swift-account-replicator /etc/swift/account-server.conf
77         /var/lib/kolla/config_files/swift_account_server.json:
78           command: /usr/bin/swift-account-server /etc/swift/account-server.conf
79         /var/lib/kolla/config_files/swift_container_auditor.json:
80           command: /usr/bin/swift-container-auditor /etc/swift/container-server.conf
81         /var/lib/kolla/config_files/swift_container_replicator.json:
82           command: /usr/bin/swift-container-replicator /etc/swift/container-server.conf
83         /var/lib/kolla/config_files/swift_container_updater.json:
84           command: /usr/bin/swift-container-updater /etc/swift/container-server.conf
85         /var/lib/kolla/config_files/swift_container_server.json:
86           command: /usr/bin/swift-container-server /etc/swift/container-server.conf
87         /var/lib/kolla/config_files/swift_object_auditor.json:
88           command: /usr/bin/swift-object-auditor /etc/swift/object-server.conf
89         /var/lib/kolla/config_files/swift_object_expirer.json:
90           command: /usr/bin/swift-object-expirer /etc/swift/object-expirer.conf
91         /var/lib/kolla/config_files/swift_object_replicator.json:
92           command: /usr/bin/swift-object-replicator /etc/swift/object-server.conf
93         /var/lib/kolla/config_files/swift_object_updater.json:
94           command: /usr/bin/swift-object-updater /etc/swift/object-server.conf
95         /var/lib/kolla/config_files/swift_object_server.json:
96           command: /usr/bin/swift-object-server /etc/swift/object-server.conf
97       docker_config:
98         step_3:
99           # The puppet config sets this up but we don't have a way to mount the named
100           # volume during the configuration stage.  We just need to create this
101           # directory and make sure it's owned by swift.
102           swift_setup_srv:
103             image:
104               list_join:
105                 - '/'
106                 - [ {get_param: DockerNamespace}, {get_param: DockerSwiftAccountImage} ]
107             user: root
108             command: ['/bin/bash', '-c', 'mkdir /srv/node && chown swift:swift /srv/node']
109             volumes:
110               - swift-srv:/srv
111         step_4:
112           swift_account_auditor:
113             image:
114               list_join:
115                 - '/'
116                 - [ {get_param: DockerNamespace}, {get_param: DockerSwiftAccountImage} ]
117             net: host
118             user: swift
119             restart: always
120             volumes:
121               - /var/lib/kolla/config_files/swift_account_auditor.json:/var/lib/kolla/config_files/config.json:ro
122               - /var/lib/config-data/swift/:/var/lib/kolla/config_files/src:ro
123               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
124               - /etc/hosts:/etc/hosts:ro
125               - /etc/localtime:/etc/localtime:ro
126               - /run:/run
127               - swift-srv:/srv
128               - /dev:/dev
129             environment: &kolla_env
130               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
131           swift_account_reaper:
132             image:
133               list_join:
134                 - '/'
135                 - [ {get_param: DockerNamespace}, {get_param: DockerSwiftAccountImage} ]
136             net: host
137             user: swift
138             restart: always
139             volumes:
140               - /var/lib/kolla/config_files/swift_account_reaper.json:/var/lib/kolla/config_files/config.json:ro
141               - /var/lib/config-data/swift/:/var/lib/kolla/config_files/src:ro
142               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
143               - /etc/hosts:/etc/hosts:ro
144               - /etc/localtime:/etc/localtime:ro
145               - /run:/run
146               - swift-srv:/srv
147               - /dev:/dev
148             environment: *kolla_env
149           swift_account_replicator:
150             image:
151               list_join:
152                 - '/'
153                 - [ {get_param: DockerNamespace}, {get_param: DockerSwiftAccountImage} ]
154             net: host
155             user: swift
156             restart: always
157             volumes:
158               - /var/lib/kolla/config_files/swift_account_replicator.json:/var/lib/kolla/config_files/config.json:ro
159               - /var/lib/config-data/swift/:/var/lib/kolla/config_files/src:ro
160               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
161               - /etc/hosts:/etc/hosts:ro
162               - /etc/localtime:/etc/localtime:ro
163               - /run:/run
164               - swift-srv:/srv
165               - /dev:/dev
166             environment: *kolla_env
167           swift_account_server:
168             image:
169               list_join:
170                 - '/'
171                 - [ {get_param: DockerNamespace}, {get_param: DockerSwiftAccountImage} ]
172             net: host
173             user: swift
174             restart: always
175             volumes:
176               - /var/lib/kolla/config_files/swift_account_server.json:/var/lib/kolla/config_files/config.json:ro
177               - /var/lib/config-data/swift/:/var/lib/kolla/config_files/src:ro
178               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
179               - /etc/hosts:/etc/hosts:ro
180               - /etc/localtime:/etc/localtime:ro
181               - /run:/run
182               - swift-srv:/srv
183               - /dev:/dev
184             environment: *kolla_env
185           swift_container_auditor:
186             image:
187               list_join:
188                 - '/'
189                 - [ {get_param: DockerNamespace}, {get_param: DockerSwiftContainerImage} ]
190             net: host
191             user: swift
192             restart: always
193             volumes:
194               - /var/lib/kolla/config_files/swift_container_auditor.json:/var/lib/kolla/config_files/config.json:ro
195               - /var/lib/config-data/swift/:/var/lib/kolla/config_files/src:ro
196               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
197               - /etc/hosts:/etc/hosts:ro
198               - /etc/localtime:/etc/localtime:ro
199               - /run:/run
200               - swift-srv:/srv
201               - /dev:/dev
202             environment: *kolla_env
203           swift_container_replicator:
204             image:
205               list_join:
206                 - '/'
207                 - [ {get_param: DockerNamespace}, {get_param: DockerSwiftContainerImage} ]
208             net: host
209             user: swift
210             restart: always
211             volumes:
212               - /var/lib/kolla/config_files/swift_container_replicator.json:/var/lib/kolla/config_files/config.json:ro
213               - /var/lib/config-data/swift/:/var/lib/kolla/config_files/src:ro
214               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
215               - /etc/hosts:/etc/hosts:ro
216               - /etc/localtime:/etc/localtime:ro
217               - /run:/run
218               - swift-srv:/srv
219               - /dev:/dev
220             environment: *kolla_env
221           swift_container_updater:
222             image:
223               list_join:
224                 - '/'
225                 - [ {get_param: DockerNamespace}, {get_param: DockerSwiftContainerImage} ]
226             net: host
227             user: swift
228             restart: always
229             volumes:
230               - /var/lib/kolla/config_files/swift_container_updater.json:/var/lib/kolla/config_files/config.json:ro
231               - /var/lib/config-data/swift/:/var/lib/kolla/config_files/src:ro
232               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
233               - /etc/hosts:/etc/hosts:ro
234               - /etc/localtime:/etc/localtime:ro
235               - /run:/run
236               - swift-srv:/srv
237               - /dev:/dev
238             environment: *kolla_env
239           swift_container_server:
240             image:
241               list_join:
242                 - '/'
243                 - [ {get_param: DockerNamespace}, {get_param: DockerSwiftContainerImage} ]
244             net: host
245             user: swift
246             restart: always
247             volumes:
248               - /var/lib/kolla/config_files/swift_container_server.json:/var/lib/kolla/config_files/config.json:ro
249               - /var/lib/config-data/swift/:/var/lib/kolla/config_files/src:ro
250               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
251               - /etc/hosts:/etc/hosts:ro
252               - /etc/localtime:/etc/localtime:ro
253               - /run:/run
254               - swift-srv:/srv
255               - /dev:/dev
256             environment: *kolla_env
257           swift_object_auditor:
258             image:
259               list_join:
260                 - '/'
261                 - [ {get_param: DockerNamespace}, {get_param: DockerSwiftObjectImage} ]
262             net: host
263             user: swift
264             restart: always
265             volumes:
266               - /var/lib/kolla/config_files/swift_object_auditor.json:/var/lib/kolla/config_files/config.json:ro
267               - /var/lib/config-data/swift/:/var/lib/kolla/config_files/src:ro
268               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
269               - /etc/hosts:/etc/hosts:ro
270               - /etc/localtime:/etc/localtime:ro
271               - /run:/run
272               - swift-srv:/srv
273               - /dev:/dev
274             environment: *kolla_env
275           swift_object_expirer:
276             image:
277               list_join:
278                 - '/'
279                 - [ {get_param: DockerNamespace}, {get_param: DockerSwiftProxyImage} ]
280             net: host
281             user: swift
282             restart: always
283             volumes:
284               - /var/lib/kolla/config_files/swift_object_expirer.json:/var/lib/kolla/config_files/config.json:ro
285               - /var/lib/config-data/swift/:/var/lib/kolla/config_files/src:ro
286               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
287               - /etc/hosts:/etc/hosts:ro
288               - /etc/localtime:/etc/localtime:ro
289               - /run:/run
290               - swift-srv:/srv
291               - /dev:/dev
292             environment: *kolla_env
293           swift_object_replicator:
294             image:
295               list_join:
296                 - '/'
297                 - [ {get_param: DockerNamespace}, {get_param: DockerSwiftObjectImage} ]
298             net: host
299             user: swift
300             restart: always
301             volumes:
302               - /var/lib/kolla/config_files/swift_object_replicator.json:/var/lib/kolla/config_files/config.json:ro
303               - /var/lib/config-data/swift/:/var/lib/kolla/config_files/src:ro
304               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
305               - /etc/hosts:/etc/hosts:ro
306               - /etc/localtime:/etc/localtime:ro
307               - /run:/run
308               - swift-srv:/srv
309               - /dev:/dev
310             environment: *kolla_env
311           swift_object_updater:
312             image:
313               list_join:
314                 - '/'
315                 - [ {get_param: DockerNamespace}, {get_param: DockerSwiftObjectImage} ]
316             net: host
317             user: swift
318             restart: always
319             volumes:
320               - /var/lib/kolla/config_files/swift_object_updater.json:/var/lib/kolla/config_files/config.json:ro
321               - /var/lib/config-data/swift/:/var/lib/kolla/config_files/src:ro
322               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
323               - /etc/hosts:/etc/hosts:ro
324               - /etc/localtime:/etc/localtime:ro
325               - /run:/run
326               - swift-srv:/srv
327               - /dev:/dev
328             environment: *kolla_env
329           swift_object_server:
330             image:
331               list_join:
332                 - '/'
333                 - [ {get_param: DockerNamespace}, {get_param: DockerSwiftObjectImage} ]
334             net: host
335             user: swift
336             restart: always
337             volumes:
338               - /var/lib/kolla/config_files/swift_object_server.json:/var/lib/kolla/config_files/config.json:ro
339               - /var/lib/config-data/swift/:/var/lib/kolla/config_files/src:ro
340               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
341               - /etc/hosts:/etc/hosts:ro
342               - /etc/localtime:/etc/localtime:ro
343               - /run:/run
344               - swift-srv:/srv
345               - /dev:/dev
346             environment: *kolla_env
347       upgrade_tasks:
348         - name: Stop and disable swift storage services
349           tags: step2
350           service: name={{ item }} state=stopped enabled=no
351           with_items:
352             - openstack-swift-account-auditor
353             - openstack-swift-account-reaper
354             - openstack-swift-account-replicator
355             - openstack-swift-account
356             - openstack-swift-container-auditor
357             - openstack-swift-container-replicator
358             - openstack-swift-container-updater
359             - openstack-swift-container
360             - openstack-swift-object-auditor
361             - openstack-swift-object-replicator
362             - openstack-swift-object-updater
363             - openstack-swift-object