-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
main.yml
107 lines (88 loc) · 3.06 KB
/
main.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
---
- hosts: raspberry_gateway
become: true
pre_tasks:
- name: Load configuration (with defaults from example file)
ansible.builtin.include_vars: "{{ item }}"
loop:
- example.config.yml
- config.yml
- advanced.config.yml
- name: Ensure apt cache is up to date
ansible.builtin.apt:
update_cache: true
cache_valid_time: 3600
when:
- ansible_facts.os_family == "Debian"
- name: Ensure pacman cache is up to date
community.general.pacman:
update_cache: true
when:
- ansible_facts.os_family == "Archlinux"
handlers:
- name: Include handlers
ansible.builtin.import_tasks: tasks/handlers.yml
tasks:
- name: Setup Docker
ansible.builtin.import_tasks: tasks/docker.yml
- name: Setup Portainer
ansible.builtin.import_tasks: tasks/portainer.yml
when: portainer_enable
- name: Setup OpenVPN Client
ansible.builtin.import_tasks: tasks/openvpn-client.yml
when: ovpn_client_enable
- name: Setup Gluetun Server
ansible.builtin.import_tasks: tasks/gluetun.yml
when: gluetun_vpnclient_enable
- name: Setup OpenVPN Server
ansible.builtin.import_tasks: tasks/openvpn-server.yml
when: ovpn_server_enable
- name: Setup Unbound DNS
ansible.builtin.import_tasks: tasks/unbound-dns.yml
when: unbound_dns_enable
- name: Setup Pi Hole
ansible.builtin.import_tasks: tasks/pi-hole.yml
when: pihole_enable
- name: Setup Technitium DNS Server
ansible.builtin.import_tasks: tasks/tech-dns.yml
when: tech_dns_enable
- name: Setup WireGuard Server
ansible.builtin.import_tasks: tasks/wireguard.yml
when: wireguard_server_enable
- name: Setup qBitTorrent
ansible.builtin.import_tasks: tasks/qbittorrent.yml
when: qbittorrent_enable
- name: Setup Samba Server
ansible.builtin.import_tasks: tasks/sambaserver.yml
when: samba_enable
- name: Setup xray
ansible.builtin.import_tasks: tasks/xray-xui.yml
when: xray_enable
- name: Setup Raspberry Monitoring
ansible.builtin.import_tasks: tasks/raspberry-monitoring.yml
when: monitoring_enable
- name: Setup Shelly Plug Monitoring
ansible.builtin.import_tasks: tasks/shelly-plug.yml
when: shelly_plug_monitoring_enable
- name: Remove Containers
ansible.builtin.include_tasks: tasks/remove.yml
vars:
remove_conditions:
- remove_portainer
- remove_unbound_dns
- remove_pihole
- remove_tech_dns
- remove_ovpn_server
- remove_ovpn_client
- remove_gluetun
- remove_wireguard
- remove_qbittorrent
- remove_samba
- remove_xray
- remove_monitoring
- remove_openvpn_monitoring
- remove_pikvm_monitoring
- remove_airgradient_monitoring
- remove_starlink_monitoring
- remove_shelly_plug_monitoring
when: remove_conditions | select('match', '^remove_') | list | length > 0