From ad50176ee9b9e74d24d2d0fbb24346296f14341c Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 8 Jan 2023 18:36:03 +0000 Subject: [PATCH] Add internal alias to pihole --- ansible/group_vars/all/pve.yml | 1 + ansible/main.yml | 4 ++++ ansible/roles/pihole/files/internal-alias.conf | 1 + ansible/roles/pihole/handlers/main.yml | 5 +++++ ansible/roles/pihole/tasks/main.yml | 7 +++++++ 5 files changed, 18 insertions(+) create mode 100644 ansible/roles/pihole/files/internal-alias.conf create mode 100644 ansible/roles/pihole/handlers/main.yml create mode 100644 ansible/roles/pihole/tasks/main.yml diff --git a/ansible/group_vars/all/pve.yml b/ansible/group_vars/all/pve.yml index b337803..7e0f84c 100644 --- a/ansible/group_vars/all/pve.yml +++ b/ansible/group_vars/all/pve.yml @@ -17,6 +17,7 @@ pve_hosts: ip: 10.23.1.107 ingress: ip: 10.23.1.10 + external_ip: 192.168.2.201 homeassistant: ip: 192.168.2.203 qbittorrent: diff --git a/ansible/main.yml b/ansible/main.yml index f3467b1..03c3092 100644 --- a/ansible/main.yml +++ b/ansible/main.yml @@ -132,3 +132,7 @@ - hosts: renovate roles: - renovate + +- hosts: tang + roles: + - pihole diff --git a/ansible/roles/pihole/files/internal-alias.conf b/ansible/roles/pihole/files/internal-alias.conf new file mode 100644 index 0000000..15c55d2 --- /dev/null +++ b/ansible/roles/pihole/files/internal-alias.conf @@ -0,0 +1 @@ +alias={{ hosts.casey_ip }},{{ pve_hosts.ingress.external_ip }} diff --git a/ansible/roles/pihole/handlers/main.yml b/ansible/roles/pihole/handlers/main.yml new file mode 100644 index 0000000..2e4a1d1 --- /dev/null +++ b/ansible/roles/pihole/handlers/main.yml @@ -0,0 +1,5 @@ +- name: restart pihole FTL + service: + name: pihole-FTL + state: restarted + become: true diff --git a/ansible/roles/pihole/tasks/main.yml b/ansible/roles/pihole/tasks/main.yml new file mode 100644 index 0000000..7b65bb9 --- /dev/null +++ b/ansible/roles/pihole/tasks/main.yml @@ -0,0 +1,7 @@ +- name: Install internal alias config + template: + src: files/internal-alias.conf + dest: /etc/dnsmasq.d/internal-alias.conf + mode: 0644 + notify: restart pihole FTL + become: true