forked from dsariel/swiftacular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy_swift_cluster.yml
134 lines (113 loc) · 2.32 KB
/
deploy_swift_cluster.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
---
- hosts:
- all
gather_facts: yes
tasks:
- name: sudo yum update && upgrade
shell: |
yum update -y
yum upgrade -y
- name: install libselinux-python
command: yum install -y python3-libselinux
# - name: set selinux to pemissive
# selinux:
# policy: targeted
# state: permissive
#
# Setup a package_cache, especially when using
# your laptop and Vagrant
#
- hosts: all
tasks:
- name: let us port bind
command: setsebool -P swift_can_network 1
- hosts: package_cache
roles:
- package_cache
- hosts:
- all
roles:
- common
- hosts: all
tasks:
- name: redirection ansible_ethN
set_fact:
ansible_eth1: "{{ ansible_enp0s8 }}"
ansible_eth2: "{{ ansible_enp0s9 }}"
ansible_eth3: "{{ ansible_enp0s10 }}"
ansible_eth4: "{{ ansible_enp0s16 }}"
# - hosts:
# - lbssl
# roles:
# - lbssl
- hosts:
- proxy
- storage
- package_cache
roles:
- swift_common
- hosts: all
tasks:
- name: redirection ansible_ethN twice
set_fact:
ansible_eth1: "{{ ansible_enp0s8 }}"
ansible_eth2: "{{ ansible_enp0s9 }}"
ansible_eth3: "{{ ansible_enp0s10 }}"
ansible_eth4: "{{ ansible_enp0s16 }}"
- hosts:
- swiftclient
roles:
- swiftclient
- hosts:
- authentication
roles:
- authentication
- hosts:
- proxy
roles:
- proxy
#
# I would have expected serial to work here, and
# to be the right way to do it but at the time I
# tried received "too many files open" errors.
#
- hosts: all
tasks:
- name: redirection ansible_ethN again
set_fact:
ansible_eth1: "{{ ansible_enp0s8 }}"
ansible_eth2: "{{ ansible_enp0s9 }}"
ansible_eth3: "{{ ansible_enp0s10 }}"
ansible_eth4: "{{ ansible_enp0s16 }}"
- hosts:
- storage
serial: 1
roles:
- storage
#
# These are not so much roles as starting services
# though also includes distributing the ring files.
#
- hosts:
- proxy
# vars_file:
# - include: vars/{{ansible_os_family}}.yml
tasks:
- include: start_proxy.yml
- hosts:
- storage
# vars_file:
# - include: vars/{{ansible_os_family}}.yml
tasks:
- include: start_storage.yml
- hosts:
- all
tasks:
- name: restore selinux state
selinux:
policy: targeted
state: enforcing
#
# Probably best to run these on their own?
#
#- include: tests/tests.yml