From 5a37bd6a7f22680f311bf9c39b6da5f29498b965 Mon Sep 17 00:00:00 2001 From: Maksim Malchuk Date: Sun, 22 Sep 2024 23:27:16 +0300 Subject: [PATCH] Add configuration for NTP server in Ironic Inspector DHCP server Followup on Ib69fc0017b3bfbc8da4dfd4301710fbf88be661a. This change adds the ability to provide the NTP (time source) server for multiple DHCP ranges in the Ironic Inspector DHCP server. Change-Id: I4bbfef3a391b8582ae73cbe06138715b43584dec Signed-off-by: Maksim Malchuk --- ansible/roles/ironic/templates/ironic-dnsmasq.conf.j2 | 5 ++--- doc/source/reference/bare-metal/ironic-guide.rst | 10 ++++++++++ ...inspector-multiple-ranges-ntp-32568dcf640a7fc1.yaml | 5 +++++ 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/ironic-inspector-multiple-ranges-ntp-32568dcf640a7fc1.yaml diff --git a/ansible/roles/ironic/templates/ironic-dnsmasq.conf.j2 b/ansible/roles/ironic/templates/ironic-dnsmasq.conf.j2 index f7eb73eb63..aa55625e93 100644 --- a/ansible/roles/ironic/templates/ironic-dnsmasq.conf.j2 +++ b/ansible/roles/ironic/templates/ironic-dnsmasq.conf.j2 @@ -9,9 +9,8 @@ bind-interfaces {% set tag = item.tag | default('range_' ~ loop.index) %} {% set lease_time = item.lease_time | default(ironic_dnsmasq_dhcp_default_lease_time) %} dhcp-range=set:{{ tag }},{{ item.range }},{{ lease_time }} -{% if item.routers is defined %} -dhcp-option=tag:{{ tag }},option:router,{{ item.routers }} -{% endif %} +{% if item.routers is defined %}dhcp-option=tag:{{ tag }},option:router,{{ item.routers }}{% endif %} +{% if item.ntp_server is defined %}dhcp-option=tag:{{ tag }},option:ntp-server,{{ item.ntp_server }}{% endif %} {% endfor %} {% if api_address_family == 'ipv6' %} diff --git a/doc/source/reference/bare-metal/ironic-guide.rst b/doc/source/reference/bare-metal/ironic-guide.rst index bf57a8f146..62fc93673d 100644 --- a/doc/source/reference/bare-metal/ironic-guide.rst +++ b/doc/source/reference/bare-metal/ironic-guide.rst @@ -42,6 +42,16 @@ are possible by separating addresses with commas): - range: "192.168.5.100,192.168.5.110" routers: "192.168.5.1" +Together with an router there can be provided the NTP (time source) server. +For example it can be the same address as default router for the range: + +.. code-block:: yaml + + ironic_dnsmasq_dhcp_ranges: + - range: "192.168.5.100,192.168.5.110" + routers: "192.168.5.1" + ntp_server: "192.168.5.1" + To support DHCP relay, it is also possible to define a netmask in the range. It is advisable to also provide a router to allow the traffic to reach the Ironic server. diff --git a/releasenotes/notes/ironic-inspector-multiple-ranges-ntp-32568dcf640a7fc1.yaml b/releasenotes/notes/ironic-inspector-multiple-ranges-ntp-32568dcf640a7fc1.yaml new file mode 100644 index 0000000000..adb060a469 --- /dev/null +++ b/releasenotes/notes/ironic-inspector-multiple-ranges-ntp-32568dcf640a7fc1.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Adds the ability to provide the NTP (time source) server for multiple DHCP + ranges in the Ironic Inspector DHCP server.