-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-swarm-server-stack-configure.yaml
148 lines (131 loc) · 3.32 KB
/
docker-swarm-server-stack-configure.yaml
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
##### INITIAL CONFIGURATION
- name: Reboot machines, install updates and standard packages, configure SNMP and network shares
hosts: docker_swarm_virtual_machines
roles:
- reboot
- base-packages
- disable-motd-ubuntu
- qemu-guest-agent-install
- cockpit-install
- snmp-configure
- network-share-mount
vars:
user: abeckett
##### PRE-SERVICE-CONFIGURATION SNAPSHOTS
- name: Take pre-service-configuration snapshot of SWARM-01
hosts: hypervisor_01
roles:
- proxmox-snapshot
vars:
vm_id: 501
snapshot_name: Pre-service-configuration
- name: Take pre-service-configuration snapshot of SWARM-02
hosts: hypervisor_01
roles:
- proxmox-snapshot
vars:
vm_id: 502
snapshot_name: Pre-service-configuration
- name: Take pre-service-configuration snapshot of SWARM-03
hosts: hypervisor_01
roles:
- proxmox-snapshot
vars:
vm_id: 503
snapshot_name: Pre-service-configuration
- name: Take pre-service-configuration snapshot of SWARM-04
hosts: hypervisor_01
roles:
- proxmox-snapshot
vars:
vm_id: 504
snapshot_name: Pre-service-configuration
- name: Take pre-service-configuration snapshot of SWARM-05
hosts: hypervisor_01
roles:
- proxmox-snapshot
vars:
vm_id: 505
snapshot_name: Pre-service-configuration
##### SERVICE INSTALL
- name: Install GlusterFS and Docker
hosts: docker_swarm_virtual_machines
roles:
- glusterfs-service
- docker-install
vars:
user: abeckett
##### SERVICE-SPECIFIC CONFIGURATIONS
- name: Configure GlusterFS and start the service
hosts: swarm_01
roles:
- glusterfs-configure
vars:
nodes:
- SWARM-02.hyvecloud.local
- SWARM-03.hyvecloud.local
- SWARM-04.hyvecloud.local
- SWARM-05.hyvecloud.local
replicas: 3
cluster:
- SWARM-01.hyvecloud.local
- SWARM-02.hyvecloud.local
- SWARM-03.hyvecloud.local
- SWARM-04.hyvecloud.local
- SWARM-05.hyvecloud.local
- name: Mount GlusterFS share to VMs
hosts: docker_swarm_virtual_machines
roles:
- glusterfs-mount
- name: Initiate swarm on first node
hosts: swarm_01
roles:
- docker-swarm-create
- name: Connect second manager to swarm
hosts: swarm_05
roles:
- docker-swarm-manager-join
- name: Connect worker nodes to swarm
hosts: swarm_02,swarm_03,swarm_04
roles:
- docker-swarm-worker-join
##### REBOOT AND POST-CONFIGURATION SNAPSHOTS
- name: Reboot Virtual Machines
hosts: docker_swarm_virtual_machines
roles:
- reboot
- name: Take post-configuration snapshot of SWARM-01
hosts: hypervisor_01
roles:
- proxmox-snapshot
vars:
vm_id: 501
snapshot_name: Post-configuration
- name: Take post-configuration snapshot of SWARM-02
hosts: hypervisor_01
roles:
- proxmox-snapshot
vars:
vm_id: 502
snapshot_name: Post-configuration
- name: Take post-configuration snapshot of SWARM-03
hosts: hypervisor_01
roles:
- proxmox-snapshot
vars:
vm_id: 503
snapshot_name: Post-configuration
- name: Take post-configuration snapshot of SWARM-04
hosts: hypervisor_01
roles:
- proxmox-snapshot
vars:
vm_id: 504
snapshot_name: Post-configuration
- name: Take post-configuration snapshot of SWARM-05
hosts: hypervisor_01
roles:
- proxmox-snapshot
vars:
vm_id: 505
snapshot_name: Post-configuration