From 57189684077027c8cc013fd674e9a353ccf5b16b Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 26 Feb 2024 18:53:36 +0100 Subject: [PATCH] fix:hard DNS on oscar instead Nas (if NAS is shutdown cluster DNS will shutdown ) --- ansible/group_vars/DNS | 4 +++- ansible/group_vars/dhcp/dhcp | 2 +- ansible/production | 2 +- nomad-job/pihole.nomad | 15 +-------------- 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/ansible/group_vars/DNS b/ansible/group_vars/DNS index 72b4884..7958d3d 100644 --- a/ansible/group_vars/DNS +++ b/ansible/group_vars/DNS @@ -18,5 +18,7 @@ pdns_rec_config: - "{{ domain.name }}=192.168.1.5" - "lan.{{ domain.name }}=192.168.1.5" - "1.168.192.in-addr.arpa=192.168.1.5:5300" - local-address: "{{ ansible_default_ipv4.address }}" + + local-address: "{{ hostvars[inventory_hostname]['ansible_'+ default_interface].ipv4.address|default(ansible_default_ipv4.address) }}" dnssec: "off" + diff --git a/ansible/group_vars/dhcp/dhcp b/ansible/group_vars/dhcp/dhcp index 6e912bc..4e5c696 100644 --- a/ansible/group_vars/dhcp/dhcp +++ b/ansible/group_vars/dhcp/dhcp @@ -3,7 +3,7 @@ dhcpd_lease_time: '72' dhcpd_domain_name: "lan.{{ domain.name }}" dhcpd_nameservers: - '192.168.1.4' - - '192.168.1.43' + - '192.168.1.40' dhcpd_zones: - zone: "lan.{{ domain.name }}." diff --git a/ansible/production b/ansible/production index 62303a2..72951d5 100644 --- a/ansible/production +++ b/ansible/production @@ -1,5 +1,5 @@ [DNS] -oberon +oscar [dhcp] oberon diff --git a/nomad-job/pihole.nomad b/nomad-job/pihole.nomad index 01f0a2d..9497d5b 100644 --- a/nomad-job/pihole.nomad +++ b/nomad-job/pihole.nomad @@ -43,19 +43,6 @@ job "pihole" { name = "dns" port = "dns" - check { - name = "service: dns dig check" - type = "script" - command = "/usr/bin/dig" - args = ["+short", "@192.168.1.4"] - interval = "10s" - timeout = "2s" - - check_restart { - limit = 3 - grace = "60s" - } - } } config { image = "pihole/pihole:2023.10.0" @@ -73,7 +60,7 @@ job "pihole" { env { TZ = "Europe/Paris" DNS1 = "192.168.1.5" - DNS2 = "192.168.1.43" + DNS2 = "192.168.1.40" WEB_PORT = "${NOMAD_PORT_http}" }