-
Notifications
You must be signed in to change notification settings - Fork 19
/
playbook.yml
51 lines (46 loc) · 1.18 KB
/
playbook.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
---
- hosts: loadbalancer
become: yes
roles:
- role: base
- role: coredns
- role: traefik
# NOTE: I'm "abusing" the load balancer VM to collect Vault
# audit logs just to avoid the need of another VM for this demo.
#
# OF COURSE AUDIT LOGS OF YOUR SECRET MANAGEMENT
# *NEVER* BELONG ON AN OUTSIDE FACING MACHINE!
- role: syslog-ng
tags: ['syslog-ng']
- hosts: consul_nomad
become: yes
roles:
- role: base
- role: consul
- role: jre
- role: docker
tags: ['docker']
- role: syslog-ng
tags: ['syslog-ng']
- role: vault
tags: ['vault']
- role: nomad
tags: ['nomad']
post_tasks:
- name: Disable systemd-resolved service
ansible.builtin.systemd:
name: systemd-resolved
state: stopped
enabled: no
tags: ['always']
- name: Set nameserver to localhost
ansible.builtin.copy:
content: "nameserver {{ loadbalancer_ip }}"
dest: /etc/resolv.conf
mode: 0644
tags: ['always']
- name: Restart Docker to pick up DNS change
ansible.builtin.systemd:
name: docker
state: restarted
tags: ['docker']