-
Notifications
You must be signed in to change notification settings - Fork 24
/
site.yml
93 lines (85 loc) · 1.99 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
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
---
- hosts: localhost
gather_facts: true
tasks:
- name: "Check ansible version >=2.8.0"
assert:
msg: "Ansible version 2.8.0 or above is required to run this playbook"
that:
- ansible_version.string is version("2.8.0", ">=")
tags:
- always
- check_version
run_once: yes
ignore_errors: "{{ ignore_assert_errors }}"
- name: install local dependencies
tags:
- local_deps
- always
apt:
name: "{{ packages }}"
state: present
update_cache: yes
vars:
packages: "{{ deb_packages }}"
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: install local dependencies
tags:
- local_deps
- always
package:
name: "{{ packages }}"
vars:
packages: "{{ centos_packages['ver' + ansible_distribution_major_version] }}"
when: ansible_distribution == 'CentOS'
- name: install gilt
pip:
executable: pip3
name: python-gilt
state: present
tags:
- local_deps
- always
- name: run gilt overlay
command: "gilt --config {{ gilt_config | default('gilt.yml') }} overlay"
changed_when: false
run_once: yes
tags: always
vars:
ansible_connection: local
centos_packages:
ver7:
- python-pip
- python3-pip
ver8:
- python3-pip
deb_packages:
- python-pip
- hosts: all
gather_facts: true
roles:
- common
- hosts: fullnode
gather_facts: true
become: true
become_method: sudo
any_errors_fatal: true
tasks:
- name: include playbook roles
tags: always
include_role:
name: "{{ roleinputvar }}"
loop: "{{ fullnode_roles }}"
loop_control:
loop_var: roleinputvar
vars:
fullnode_roles:
- docker
- iri
- iotacaddy
- nginx
- iotapm
- monitoring
- consul
- haproxy
- cleanup