forked from ccollicutt/swiftacular
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstart_proxy.yml
35 lines (29 loc) · 1.01 KB
/
start_proxy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
#
# Create files necessary to start the proxy and also start it
#
- name: rebalance rings
command: swift-ring-builder {{ item }}.builder rebalance
creates=/etc/swift/{{ item }}.ring.gz
chdir=/etc/swift
register: rebalance
with_items:
- account
- object
- container
# This will fetch from all proxies, if there are more than one and put the rings files in the same spot, which is Ok but not perfect
- name: grab resulting *.ring.gz files and put them on all proxy and storage nodes
fetch: dest=fetch/{{ item }}.ring.gz flat=yes src=/etc/swift/{{ item }}.ring.gz
when: rebalance.changed
with_items:
- account
- object
- container
- name: start swift-proxy on proxy nodes
service: name=swift-proxy state=started
when: ansible_os_family == 'Debian'
- name: start swift-proxy on proxy nodes
service: name=openstack-swift-proxy state=started
when: ansible_os_family == 'RedHat'
- name: start object-expirer on proxy nodes
command: swift-init object-expirer start