45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
---
|
|
- name: Wait for Cloud-init to finish
|
|
hosts: all
|
|
gather_facts: no
|
|
roles:
|
|
- cloudinit_wait
|
|
|
|
- hosts: all
|
|
pre_tasks:
|
|
- name: Delete externally managed environment file
|
|
shell:
|
|
cmd: "rm /usr/lib/python*/EXTERNALLY-MANAGED"
|
|
register: rm
|
|
changed_when: "rm.rc == 0"
|
|
failed_when: "false"
|
|
roles:
|
|
- {role: docker, tags: docker}
|
|
- {role: setup_apt, tags: setup_apt}
|
|
- {role: wireguard, tags: wireguard}
|
|
post_tasks:
|
|
- name: Disable systemd-resolved
|
|
systemd:
|
|
name: systemd-resolved
|
|
enabled: false
|
|
state: stopped
|
|
- name: Copy resolv.conf
|
|
copy:
|
|
src: resolv.conf
|
|
dest: /etc/resolv.conf
|
|
- name: Copy pi-hole docker compose
|
|
copy:
|
|
src: docker-compose.yml
|
|
dest: /root/docker-compose.yml
|
|
- name: Start pi-hole
|
|
docker_compose:
|
|
project_src: /root
|
|
pull: true
|
|
remove_orphans: true
|
|
- name: Enable routing
|
|
sysctl:
|
|
name: net.ipv4.ip_forward
|
|
value: '1'
|
|
sysctl_set: true
|
|
state: present
|
|
reload: true
|