From 053bc1b1e3946bec5a0db131742de08571905bd2 Mon Sep 17 00:00:00 2001 From: Hayato Date: Sun, 17 Nov 2024 17:48:23 +0900 Subject: [PATCH] Using rui/mai dns --- .github/workflows/main_branch.yml | 2 +- inventories/host_vars/{rui => dns}/CNAME.yml | 0 inventories/host_vars/{rui => dns}/NXDOMAIN.yml | 0 inventories/host_vars/mai.yml | 8 ++++++-- inventories/host_vars/rui.yml | 6 +++++- mai.yml | 4 ++-- rui.yml | 4 ++-- 7 files changed, 16 insertions(+), 8 deletions(-) rename inventories/host_vars/{rui => dns}/CNAME.yml (100%) rename inventories/host_vars/{rui => dns}/NXDOMAIN.yml (100%) diff --git a/.github/workflows/main_branch.yml b/.github/workflows/main_branch.yml index f5c12c0..feba560 100644 --- a/.github/workflows/main_branch.yml +++ b/.github/workflows/main_branch.yml @@ -53,7 +53,7 @@ jobs: - name: NXDOMAIN_Duplicate_Check run: > "./dupcheck.sh" - "inventories/host_vars/rui/NXDOMAIN.yml" + "inventories/host_vars/dns/NXDOMAIN.yml" Dry_Run_ansible: needs: diff --git a/inventories/host_vars/rui/CNAME.yml b/inventories/host_vars/dns/CNAME.yml similarity index 100% rename from inventories/host_vars/rui/CNAME.yml rename to inventories/host_vars/dns/CNAME.yml diff --git a/inventories/host_vars/rui/NXDOMAIN.yml b/inventories/host_vars/dns/NXDOMAIN.yml similarity index 100% rename from inventories/host_vars/rui/NXDOMAIN.yml rename to inventories/host_vars/dns/NXDOMAIN.yml diff --git a/inventories/host_vars/mai.yml b/inventories/host_vars/mai.yml index c0475c4..d7d7924 100644 --- a/inventories/host_vars/mai.yml +++ b/inventories/host_vars/mai.yml @@ -6,6 +6,10 @@ apt: - htop - rsyslog +rui_info: "{{ network | selectattr('shortname', 'eq', 'rui') }}" +rui_ipv4: "{{ rui_info[0].ipv4 }}" +rui_interface: "{{ rui_info[0].interface }}" + mai_info: "{{ network | selectattr('shortname', 'eq', 'mai') }}" mai_ipv4: "{{ mai_info[0].ipv4 }}" mai_interface: "{{ mai_info[0].interface }}" @@ -17,12 +21,12 @@ dnsmasq: interface: "{{ mai_interface }}" dhcp_range: start: 192.168.1.151 - end: 192.168.1.191 + end: 192.168.1.199 netmask: 255.255.255.0 ttl: "12h" dhcp_option: ntp_server: 210.130.188.10 - dns_server: "{{ mai_ipv4 }}" + dns_server: "{{ mai_ipv4 }},{{ rui_ipv4 }}" router: "{{ subnet.gw4 }}" netmask: "255.255.255.0" dns: diff --git a/inventories/host_vars/rui.yml b/inventories/host_vars/rui.yml index 1f93194..059d636 100644 --- a/inventories/host_vars/rui.yml +++ b/inventories/host_vars/rui.yml @@ -11,6 +11,10 @@ rui_info: "{{ network | selectattr('shortname', 'eq', 'rui') }}" rui_ipv4: "{{ rui_info[0].ipv4 }}" rui_interface: "{{ rui_info[0].interface }}" +mai_info: "{{ network | selectattr('shortname', 'eq', 'mai') }}" +mai_ipv4: "{{ mai_info[0].ipv4 }}" +mai_interface: "{{ mai_info[0].interface }}" + dnsmasq: domain: hayaworld.home local: /hayaworld.home/ @@ -23,7 +27,7 @@ dnsmasq: ttl: "12h" dhcp_option: ntp_server: 210.130.188.10 - dns_server: "{{ rui_ipv4 }}" + dns_server: "{{ rui_ipv4 }},{{ mai_ipv4 }}" router: "{{ subnet.gw4 }}" netmask: "255.255.255.0" dns: diff --git a/mai.yml b/mai.yml index 8fcfe60..2c39394 100644 --- a/mai.yml +++ b/mai.yml @@ -6,8 +6,8 @@ become: true vars_files: - - inventories/host_vars/rui/NXDOMAIN.yml - - inventories/host_vars/rui/CNAME.yml + - inventories/host_vars/dns/NXDOMAIN.yml + - inventories/host_vars/dns/CNAME.yml - inventories/host_vars/mai.yml - inventories/host_vars/networks.yml diff --git a/rui.yml b/rui.yml index 8fc2f57..e45d673 100644 --- a/rui.yml +++ b/rui.yml @@ -6,8 +6,8 @@ become: true vars_files: - - inventories/host_vars/rui/NXDOMAIN.yml - - inventories/host_vars/rui/CNAME.yml + - inventories/host_vars/dns/NXDOMAIN.yml + - inventories/host_vars/dns/CNAME.yml - inventories/host_vars/rui.yml - inventories/host_vars/networks.yml