From 4372b219761c37b83a12333bffde0d46c2e09112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoha=C3=AF-Eliel=20BERREBY?= Date: Fri, 8 May 2020 16:36:07 +0200 Subject: [PATCH] dhcp: allow different router IP suffix This variable is only needed because we're in the process of deploying keepalived. For now it's only at EDC. --- group_vars/edc/main.yml | 1 + group_vars/fleming/main.yml | 1 + group_vars/georgesand/main.yml | 2 ++ group_vars/pacaterie/main.yml | 2 ++ roles/isc-dhcp-server/templates/dhcp/dhcpd.conf.j2 | 4 ++-- 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/group_vars/edc/main.yml b/group_vars/edc/main.yml index d6cc8d4..54f11bc 100644 --- a/group_vars/edc/main.yml +++ b/group_vars/edc/main.yml @@ -7,3 +7,4 @@ subnet_ids: users_wired: 40 users_wifi: 41 +router_ip_suffix: 254 diff --git a/group_vars/fleming/main.yml b/group_vars/fleming/main.yml index 93abe36..5552c57 100644 --- a/group_vars/fleming/main.yml +++ b/group_vars/fleming/main.yml @@ -7,3 +7,4 @@ subnet_ids: users_wired: 10 users_wifi: 11 +router_ip_suffix: 240 diff --git a/group_vars/georgesand/main.yml b/group_vars/georgesand/main.yml index 0d233a5..0161c8a 100644 --- a/group_vars/georgesand/main.yml +++ b/group_vars/georgesand/main.yml @@ -1,3 +1,5 @@ --- apartment_block: gs apartment_block_id: 5 + +router_ip_suffix: 240 diff --git a/group_vars/pacaterie/main.yml b/group_vars/pacaterie/main.yml index e51113e..bb0face 100644 --- a/group_vars/pacaterie/main.yml +++ b/group_vars/pacaterie/main.yml @@ -6,3 +6,5 @@ subnet_ids: ap: 142 users_wired: 20 users_wifi: 21 + +router_ip_suffix: 240 diff --git a/roles/isc-dhcp-server/templates/dhcp/dhcpd.conf.j2 b/roles/isc-dhcp-server/templates/dhcp/dhcpd.conf.j2 index dc642ae..bad8558 100644 --- a/roles/isc-dhcp-server/templates/dhcp/dhcpd.conf.j2 +++ b/roles/isc-dhcp-server/templates/dhcp/dhcpd.conf.j2 @@ -44,7 +44,7 @@ subnet 10.{{ subnet_ids.users_wired }}.0.0 netmask 255.255.0.0 { interface "ens20"; option subnet-mask 255.255.0.0; option broadcast-address 10.{{ subnet_ids.users_wired }}.255.255; - option routers 10.{{ subnet_ids.users_wired }}.0.240; + option routers 10.{{ subnet_ids.users_wired }}.0.{{ router_ip_suffix }}; option domain-name "fil.{{ apartment_block }}.auro.re"; option domain-search "auro.re"; @@ -61,7 +61,7 @@ subnet 10.{{ subnet_ids.users_wifi }}.0.0 netmask 255.255.0.0 { interface "ens21"; option subnet-mask 255.255.0.0; option broadcast-address 10.{{ subnet_ids.users_wifi }}.255.255; - option routers 10.{{ subnet_ids.users_wifi }}.0.240; + option routers 10.{{ subnet_ids.users_wifi }}.0.{{ router_ip_suffix }}; option domain-name "wifi.{{ apartment_block }}.auro.re"; option domain-search "auro.re";