From e8ae953db20166d5c35cc32f2d50cc44d4913c7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Nasiadka?= Date: Fri, 13 Aug 2021 07:47:42 +0200 Subject: [PATCH] Add support for being dhcp relay target Change-Id: I74af38dc555b7edee8331e31dfd1a2fbfe4f1151 --- playbooks/roles/bifrost-ironic-install/README.md | 4 ++++ .../roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 | 2 +- releasenotes/notes/dhcp_pool_mask-6d9bd4d1b78be0ab.yaml | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/dhcp_pool_mask-6d9bd4d1b78be0ab.yaml diff --git a/playbooks/roles/bifrost-ironic-install/README.md b/playbooks/roles/bifrost-ironic-install/README.md index c7c94ead1..7251f520b 100644 --- a/playbooks/roles/bifrost-ironic-install/README.md +++ b/playbooks/roles/bifrost-ironic-install/README.md @@ -74,6 +74,10 @@ If you chose to utilize the dhcp server, You may wish to set default ranges: dhcp_pool_start: 192.168.1.200 dhcp_pool_end: 192.168.1.250 +If you want to use bifrost as a dhcp relay target, please set ``dhcp_pool_mask``: + +dhcp_pool_mask: 255.255.255.0 + And also set the default dhcp address lease time: dhcp_lease_time: 12h diff --git a/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 b/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 index 478ce4cf7..78d725fb2 100644 --- a/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 +++ b/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 @@ -66,7 +66,7 @@ dhcp-range=192.168.122.2,192.168.122.254,12h {% elif inventory_dhcp | bool == true %} dhcp-range={{dhcp_pool_start}},static,{{dhcp_static_mask}},{{dhcp_lease_time}} {% else %} -dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},{{dhcp_lease_time}} +dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},{% if dhcp_pool_mask is defined %}{{dhcp_pool_mask}},{% endif %}{{dhcp_lease_time}} {% endif %} # Override the default route supplied by dnsmasq, which assumes the diff --git a/releasenotes/notes/dhcp_pool_mask-6d9bd4d1b78be0ab.yaml b/releasenotes/notes/dhcp_pool_mask-6d9bd4d1b78be0ab.yaml new file mode 100644 index 000000000..6ec10ad6d --- /dev/null +++ b/releasenotes/notes/dhcp_pool_mask-6d9bd4d1b78be0ab.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Adds support for using dnsmasq as a DHCP relay target via the new + ``dhcp_pool_mask`` parameter.