-
Notifications
You must be signed in to change notification settings - Fork 0
/
general_network_services.yml
174 lines (156 loc) · 4.13 KB
/
general_network_services.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
---
- name: Network Config - Configure Time Server
become: true
hosts: rpi-util1.core.home.gatwards.org
tasks:
- name: Network Config - Configure GPSd
tags:
- gpsd
- ntp
import_role:
name: ansible-role-gpsd
vars:
gpsd_devices:
- /dev/ttyAMA0
- /dev/pps0
gpsd_run_as_root: true
gpsd_listen_all_interfaces: true
- name: Network Config - Configure Chrony Server
tags:
- chrony
- ntp
import_role:
name: ansible-role-chrony
vars:
chrony_config_server:
- 0.pool.ntp.org
chrony_config_extra_options:
allow: 172.22.0.0/21
local: stratum 10
refclock: SHM 0 delay 0.2 refid GPS
#refclock: PPS /dev/pps0 refid PPS
- name: Network Config - Update firewall rules (ports)
tags:
- chrony
- gpsd
- ntp
firewalld:
port: "{{ item }}"
immediate: yes
permanent: yes
state: enabled
with_items:
- 2947/tcp
- 3333/tcp
- name: Network Config - Update firewall rules (services)
tags:
- chrony
- gpsd
- ntp
firewalld:
service: "{{ item }}"
immediate: yes
permanent: yes
state: enabled
with_items:
- ntp
####################################################################################
- name: Network Config - Provision InfluxDB container
become: true
hosts: docker_nas
vars_files:
- vault.yml
tasks:
- name: Network Config - Configure InfluxDB
tags:
- influxdb
- monitoring
- docker
import_role:
name: ansible-role-docker-influxdb
vars:
docker_persistent_store_root: /volume2/docker/influxdb
- name: Network Config - Create Databases
tags:
- influxdb
- monitoring
- docker
influxdb_database:
database_name: "{{ item.name }}"
hostname: influxdb.core.home.gatwards.org
with_items: "{{ hostvars[groups['influxdb'][0]].influxdb_databases }}"
- name: Network Config - Configure retention policies
tags:
- influxdb
- monitoring
- docker
influxdb_retention_policy:
database_name: "{{ item.name }}"
hostname: influxdb.core.home.gatwards.org
duration: "{{ item.retention_policy.duration }}"
policy_name: "{{ item.retention_policy.name }}"
replication: 1
with_items: "{{ hostvars[groups['influxdb'][0]].influxdb_databases }}"
####################################################################################
- name: Network Config - Provision Grafana container
remote_user: svc-ansible
become: true
hosts: docker_nas
vars_files:
- vault.yml
tasks:
- name: Network Config - Configure Grafana
tags:
- monitoring
- grafana
- docker
import_role:
name: ansible-role-docker-grafana
vars:
docker_persistent_store_root: /volume2/docker/grafana
####################################################################################
- name: Network Config - Provision UniFi container
remote_user: svc-ansible
become: true
hosts: docker_nas
vars_files:
- vault.yml
tasks:
- name: Network Config - Configure UniFi
tags:
- unifi
- docker
import_role:
name: ansible-role-docker-unifi
####################################################################################
- name: Network Config - Provision NAS node_exporter container
remote_user: svc-ansible
become: true
hosts: docker_nas
tasks:
- name: Network Config - Deploy node_exporter container
tags:
- monitoring
- node_exporter
- docker
docker_container:
name: node_exporter
image: prom/node-exporter
restart_policy: unless-stopped
published_ports:
- '9100:9100'
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- "--path.procfs=/host/proc"
- "--path.sysfs=/host/sys"
- "--collector.filesystem.ignored-mount-points"
- "^/(rootfs/)?(dev|etc|host|proc|run|sys|volume1)($$|/)"
####################################################################################
handlers:
- name: Network Config - restart_sshd
systemd:
name: sshd
state: restarted