-
Notifications
You must be signed in to change notification settings - Fork 4
/
scrutiny.yml
111 lines (100 loc) · 4.17 KB
/
scrutiny.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
---
- hosts: homelab
vars:
application: scrutiny
scrutiny_mattermost_token: !vault |
$ANSIBLE_VAULT;1.1;AES256
30653664646435353630326235646636663231666132356630623066396230383336303464646563
6565383536363962303330373731373031343463653336640a626562666263313938313163326630
63343063623037346133323164626638353264643633346331656364653131663531313132643464
3363346239376138310a366430306236626330643331386461346266666530643930386465326439
66333563343334313730353065636338326536613530663862333761303534623062
docker_network: "{{ networks.pub }}"
handlers:
- name: Restart
community.docker.docker_container:
name: "{{ application }}-web"
restart: true
comparisons:
'*': ignore
tasks:
- name: Create config folders
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: "{{ common_user }}"
group: "{{ common_group }}"
mode: "0771"
loop:
- "{{ config_directory }}"
- "{{ config_directory }}/config"
- name: Get disks
ansible.builtin.shell: for line in $(lsblk --noheadings --list --scsi --output name); do echo "/dev/${line}"; done
register: lsblk_disks
changed_when: false
- name: Create influxdb container
ansible.builtin.import_role:
name: influxdb
vars:
influxdb_version: 2.2
influxdb_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
63366261656539306233343037303463353065356666313237656235373931366464346639646566
3034303463303537333961336535303736626131333366610a376539393631653738386638666334
64346463626365363164366331616333313361336464666434633330636562303661613832363730
3137613961623630380a306337343664653433373235373764633662373835303635386532643465
63303764356237663361626165306236343030353865363164346361633735333438383635303736
63636134363266613664353531333531653139663264396236386330653764363663663838623038
65303034363230663030663165353264633734306239333437356434633739663734626465303035
34303366656137363966
influxdb_token: !vault |
$ANSIBLE_VAULT;1.1;AES256
65663837636636656238616233306435356632373337333935303735336165383362623465366463
3266333866643231323038346233396564353361656633330a613265353564336163623439356237
33323834663564393231626333616464613164366161633161373036636639613438326332623136
3537616637313239380a616530336230353264393339373232633430393765323038323561323862
66303732666238306663623332663562393764323665383766313066383237633739333063623764
36353436383062626532336661353561633639353735336535326137373465336161633430643639
35316666326539323063633937666663316539313264343231623261653533666138353561356431
62353136626331656663
influxdb_homepage:
enable: false
- name: Template config
ansible.builtin.template:
src: "{{ files_directory }}/scrutiny.yaml.j2"
dest: "{{ config_directory }}/config/scrutiny.yaml"
mode: "0440"
notify: Restart
- name: Create web container
ansible.builtin.include_role:
name: docker_container
vars:
name: "{{ application }}-web"
image: ghcr.io/analogj/scrutiny:v0.8.1-web
volumes:
- "{{ config_directory }}/config:/opt/scrutiny/config"
traefik:
- port: 8080
auth: page
rule: Host(`{{ application }}.{{ common_tld }}`)
homepage:
group: Storage
weight: 250
description: "S.M.A.R.T. monitoring"
widget: {}
blackbox:
path: /api/status
- name: Create collector container
ansible.builtin.include_role:
name: docker_container
vars:
name: "{{ application }}-collector"
image: ghcr.io/analogj/scrutiny:v0.8.1-collector
env:
COLLECTOR_CRON_SCHEDULE: "*/5 * * * *"
COLLECTOR_API_ENDPOINT: "http://{{ application }}-web.{{ docker_network.name }}:8080"
capabilities:
- SYS_RAWIO
volumes:
- /run/udev:/run/udev:ro
devices: "{{ lsblk_disks.stdout_lines }}"