-
Notifications
You must be signed in to change notification settings - Fork 2
/
site.yml
46 lines (38 loc) · 1.09 KB
/
site.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
---
# This playbook deploys the swarm configuration on multiple Docker hosts
# Determine the processor architecture of the machines defined in the inventory
- name: Determine the processor of the target platform
hosts: all
tasks:
- set_fact: architecture="{{ ((ansible_architecture|truncate(3,true,'')) == 'arm') | ternary('ARM','X86') }}"
- hosts: all
tasks:
- debug: msg="architecture is set to {{ architecture }}"
# Apply common configuration to all hosts
- hosts: swarm
become: true
roles:
- common
- gpio
# Deploy the visualization container on the first Swarm Manager
- hosts: swarmManagers[0]
become: true
roles:
- swarmVisualization
- swarmManager
# Deploy the Swarm Nodes
- hosts: swarmNodes
become: true
roles:
- swarmNode
# Todo: add the additional Swarm managers that are define in the inventory file
# Deploy the swarm services
- hosts: swarmManagers[0]
become: true
roles:
- swarmServices
# Open the swarm visualization page and the running services in a browser on the localhost
- hosts: localhost
connection: local
roles:
- monitoring