Merge "Add manual ovs upgrade script for workaround ovs upgrade issue"
[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       puppet_config:
62         config_volume: swift
63         puppet_tags: swift_config,swift_container_config,swift_container_sync_realms_config,swift_account_config,swift_object_config,swift_object_expirer_config
64         step_config: *step_config
65         config_image: &swift_proxy_image
66           list_join:
67             - '/'
68             - [ {get_param: DockerNamespace}, {get_param: DockerSwiftProxyImage} ]
69       kolla_config:
70         /var/lib/kolla/config_files/swift_account_auditor.json:
71           command: /usr/bin/swift-account-auditor /etc/swift/account-server.conf
72         /var/lib/kolla/config_files/swift_account_reaper.json:
73           command: /usr/bin/swift-account-reaper /etc/swift/account-server.conf
74         /var/lib/kolla/config_files/swift_account_replicator.json:
75           command: /usr/bin/swift-account-replicator /etc/swift/account-server.conf
76         /var/lib/kolla/config_files/swift_account_server.json:
77           command: /usr/bin/swift-account-server /etc/swift/account-server.conf
78         /var/lib/kolla/config_files/swift_container_auditor.json:
79           command: /usr/bin/swift-container-auditor /etc/swift/container-server.conf
80         /var/lib/kolla/config_files/swift_container_replicator.json:
81           command: /usr/bin/swift-container-replicator /etc/swift/container-server.conf
82         /var/lib/kolla/config_files/swift_container_updater.json:
83           command: /usr/bin/swift-container-updater /etc/swift/container-server.conf
84         /var/lib/kolla/config_files/swift_container_server.json:
85           command: /usr/bin/swift-container-server /etc/swift/container-server.conf
86         /var/lib/kolla/config_files/swift_object_auditor.json:
87           command: /usr/bin/swift-object-auditor /etc/swift/object-server.conf
88         /var/lib/kolla/config_files/swift_object_expirer.json:
89           command: /usr/bin/swift-object-expirer /etc/swift/object-expirer.conf
90         /var/lib/kolla/config_files/swift_object_replicator.json:
91           command: /usr/bin/swift-object-replicator /etc/swift/object-server.conf
92         /var/lib/kolla/config_files/swift_object_updater.json:
93           command: /usr/bin/swift-object-updater /etc/swift/object-server.conf
94         /var/lib/kolla/config_files/swift_object_server.json:
95           command: /usr/bin/swift-object-server /etc/swift/object-server.conf
96       docker_config:
97         step_3:
98           # The puppet config sets this up but we don't have a way to mount the named
99           # volume during the configuration stage.  We just need to create this
100           # directory and make sure it's owned by swift.
101           swift_setup_srv:
102             image: &swift_account_image
103               list_join:
104                 - '/'
105                 - [ {get_param: DockerNamespace}, {get_param: DockerSwiftAccountImage} ]
106             user: root
107             command: ['chown', '-R', 'swift:', '/srv/node']
108             volumes:
109               - /srv/node:/srv/node
110         step_4:
111           swift_account_auditor:
112             image: *swift_account_image
113             net: host
114             user: swift
115             restart: always
116             volumes:
117               - /var/lib/kolla/config_files/swift_account_auditor.json:/var/lib/kolla/config_files/config.json:ro
118               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
119               - /etc/hosts:/etc/hosts:ro
120               - /etc/localtime:/etc/localtime:ro
121               - /run:/run
122               - /srv/node:/srv/node
123               - /dev:/dev
124             environment: &kolla_env
125               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
126           swift_account_reaper:
127             image: *swift_account_image
128             net: host
129             user: swift
130             restart: always
131             volumes:
132               - /var/lib/kolla/config_files/swift_account_reaper.json:/var/lib/kolla/config_files/config.json:ro
133               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
134               - /etc/hosts:/etc/hosts:ro
135               - /etc/localtime:/etc/localtime:ro
136               - /run:/run
137               - /srv/node:/srv/node
138               - /dev:/dev
139             environment: *kolla_env
140           swift_account_replicator:
141             image: *swift_account_image
142             net: host
143             user: swift
144             restart: always
145             volumes:
146               - /var/lib/kolla/config_files/swift_account_replicator.json:/var/lib/kolla/config_files/config.json:ro
147               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
148               - /etc/hosts:/etc/hosts:ro
149               - /etc/localtime:/etc/localtime:ro
150               - /run:/run
151               - /srv/node:/srv/node
152               - /dev:/dev
153             environment: *kolla_env
154           swift_account_server:
155             image: *swift_account_image
156             net: host
157             user: swift
158             restart: always
159             volumes:
160               - /var/lib/kolla/config_files/swift_account_server.json:/var/lib/kolla/config_files/config.json:ro
161               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
162               - /etc/hosts:/etc/hosts:ro
163               - /etc/localtime:/etc/localtime:ro
164               - /run:/run
165               - /srv/node:/srv/node
166               - /dev:/dev
167             environment: *kolla_env
168           swift_container_auditor:
169             image: &swift_container_image
170               list_join:
171                 - '/'
172                 - [ {get_param: DockerNamespace}, {get_param: DockerSwiftContainerImage} ]
173             net: host
174             user: swift
175             restart: always
176             volumes:
177               - /var/lib/kolla/config_files/swift_container_auditor.json:/var/lib/kolla/config_files/config.json: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               - /srv/node:/srv/node
183               - /dev:/dev
184             environment: *kolla_env
185           swift_container_replicator:
186             image: *swift_container_image
187             net: host
188             user: swift
189             restart: always
190             volumes:
191               - /var/lib/kolla/config_files/swift_container_replicator.json:/var/lib/kolla/config_files/config.json:ro
192               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
193               - /etc/hosts:/etc/hosts:ro
194               - /etc/localtime:/etc/localtime:ro
195               - /run:/run
196               - /srv/node:/srv/node
197               - /dev:/dev
198             environment: *kolla_env
199           swift_container_updater:
200             image: *swift_container_image
201             net: host
202             user: swift
203             restart: always
204             volumes:
205               - /var/lib/kolla/config_files/swift_container_updater.json:/var/lib/kolla/config_files/config.json:ro
206               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
207               - /etc/hosts:/etc/hosts:ro
208               - /etc/localtime:/etc/localtime:ro
209               - /run:/run
210               - /srv/node:/srv/node
211               - /dev:/dev
212             environment: *kolla_env
213           swift_container_server:
214             image: *swift_container_image
215             net: host
216             user: swift
217             restart: always
218             volumes:
219               - /var/lib/kolla/config_files/swift_container_server.json:/var/lib/kolla/config_files/config.json:ro
220               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
221               - /etc/hosts:/etc/hosts:ro
222               - /etc/localtime:/etc/localtime:ro
223               - /run:/run
224               - /srv/node:/srv/node
225               - /dev:/dev
226             environment: *kolla_env
227           swift_object_auditor:
228             image: &swift_object_image
229               list_join:
230                 - '/'
231                 - [ {get_param: DockerNamespace}, {get_param: DockerSwiftObjectImage} ]
232             net: host
233             user: swift
234             restart: always
235             volumes:
236               - /var/lib/kolla/config_files/swift_object_auditor.json:/var/lib/kolla/config_files/config.json:ro
237               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
238               - /etc/hosts:/etc/hosts:ro
239               - /etc/localtime:/etc/localtime:ro
240               - /run:/run
241               - /srv/node:/srv/node
242               - /dev:/dev
243             environment: *kolla_env
244           swift_object_expirer:
245             image: *swift_proxy_image
246             net: host
247             user: swift
248             restart: always
249             volumes:
250               - /var/lib/kolla/config_files/swift_object_expirer.json:/var/lib/kolla/config_files/config.json:ro
251               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
252               - /etc/hosts:/etc/hosts:ro
253               - /etc/localtime:/etc/localtime:ro
254               - /run:/run
255               - /srv/node:/srv/node
256               - /dev:/dev
257             environment: *kolla_env
258           swift_object_replicator:
259             image: *swift_object_image
260             net: host
261             user: swift
262             restart: always
263             volumes:
264               - /var/lib/kolla/config_files/swift_object_replicator.json:/var/lib/kolla/config_files/config.json:ro
265               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
266               - /etc/hosts:/etc/hosts:ro
267               - /etc/localtime:/etc/localtime:ro
268               - /run:/run
269               - /srv/node:/srv/node
270               - /dev:/dev
271             environment: *kolla_env
272           swift_object_updater:
273             image: *swift_object_image
274             net: host
275             user: swift
276             restart: always
277             volumes:
278               - /var/lib/kolla/config_files/swift_object_updater.json:/var/lib/kolla/config_files/config.json:ro
279               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
280               - /etc/hosts:/etc/hosts:ro
281               - /etc/localtime:/etc/localtime:ro
282               - /run:/run
283               - /srv/node:/srv/node
284               - /dev:/dev
285             environment: *kolla_env
286           swift_object_server:
287             image: *swift_object_image
288             net: host
289             user: swift
290             restart: always
291             volumes:
292               - /var/lib/kolla/config_files/swift_object_server.json:/var/lib/kolla/config_files/config.json:ro
293               - /var/lib/config-data/swift/etc/swift:/etc/swift:rw
294               - /etc/hosts:/etc/hosts:ro
295               - /etc/localtime:/etc/localtime:ro
296               - /run:/run
297               - /srv/node:/srv/node
298               - /dev:/dev
299             environment: *kolla_env
300       host_prep_tasks:
301         - name: create /srv/node
302           file:
303             path: /srv/node
304             state: directory
305       upgrade_tasks:
306         - name: Stop and disable swift storage services
307           tags: step2
308           service: name={{ item }} state=stopped enabled=no
309           with_items:
310             - openstack-swift-account-auditor
311             - openstack-swift-account-reaper
312             - openstack-swift-account-replicator
313             - openstack-swift-account
314             - openstack-swift-container-auditor
315             - openstack-swift-container-replicator
316             - openstack-swift-container-updater
317             - openstack-swift-container
318             - openstack-swift-object-auditor
319             - openstack-swift-object-replicator
320             - openstack-swift-object-updater
321             - openstack-swift-object