-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathmain.yml
63 lines (53 loc) · 1.72 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
---
- hosts: openvpn-aws
become: true
pre_tasks:
- name: Load configuration (with defaults from example file).
ansible.builtin.include_vars: "{{ item }}"
loop:
- example.config.yml
- 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
when: ansible_distribution != "Ubuntu"
tasks:
- name: Setup Docker.
ansible.builtin.import_tasks: tasks/docker.yml
when:
- ansible_distribution != "Ubuntu"
- name: Set up OpenVPN.
ansible.builtin.import_tasks: tasks/openvpn.yml
when:
- ovpn_enable
- ansible_distribution != "Ubuntu"
- name: Set up OpenVPN Monitoring.
ansible.builtin.import_tasks: tasks/openvpn_monitoring.yml
when:
- monitoring_enable
- ansible_distribution != "Ubuntu"
- name: Setup Docker (Ubuntu).
ansible.builtin.include_tasks: tasks/docker_ubuntu.yml
when:
- ansible_distribution == "Ubuntu"
- name: Set up OpenVPN (Ubuntu).
ansible.builtin.include_tasks: tasks/openvpn_ubuntu.yml
when:
- ovpn_enable
- ansible_distribution == "Ubuntu"
- name: Set up OpenVPN Monitoring (Ubuntu).
ansible.builtin.include_tasks: tasks/openvpn_monitoring_ubuntu.yml
when:
- monitoring_enable
- ansible_distribution == "Ubuntu"