diff --git a/playbooks/inventory/group_vars/localhost b/playbooks/inventory/group_vars/localhost index 01eec7dea..44ebd51c3 100644 --- a/playbooks/inventory/group_vars/localhost +++ b/playbooks/inventory/group_vars/localhost @@ -65,3 +65,8 @@ create_ipa_image: false # clients as default route the same IP of the dnsmasq server. # Default: undefined # dnsmasq_router: {{ ipv4_gateway }} + +# Dnsmasq default nameserver for clients. If not defined, this setting +# will be ignored. +# Default: undefined +# dnsmasq_dns_servers: 8.8.8.8,8.8.4.4 diff --git a/playbooks/roles/bifrost-ironic-install/defaults/main.yml b/playbooks/roles/bifrost-ironic-install/defaults/main.yml index fe492db8c..e9bdca1fd 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/main.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/main.yml @@ -72,6 +72,10 @@ dhcp_static_mask: 255.255.255.0 # Default: undefined # dnsmasq_router: +# Dnsmasq default dns servers for clients. If defined, dnsmasq will use the specified +# DNS servers for name resolving. +# dnsmasq_dns_servers: 8.8.8.8,8.8.4.4 + # Support for CORS configuration # By default CORS support is disabled. enable_cors: false diff --git a/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 b/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 index 637241353..bfb4b933c 100644 --- a/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 +++ b/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 @@ -78,6 +78,10 @@ dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},{{dhcp_lease_time}} dhcp-option=3,{{dnsmasq_router}} {% endif %} +{% if dnsmasq_dns_servers is defined %} +dhcp-option=6,{{dnsmasq_dns_servers}} +{% endif %} + # Boot for Etherboot gPXE. The idea is to send two different # filenames, the first loads gPXE, and the second tells gPXE what to # load. The dhcp-match sets the gpxe tag for requests from gPXE. diff --git a/releasenotes/notes/populate_dns_servers_dnsmasq-4f30a9957e8de732.yaml b/releasenotes/notes/populate_dns_servers_dnsmasq-4f30a9957e8de732.yaml new file mode 100644 index 000000000..98629c05d --- /dev/null +++ b/releasenotes/notes/populate_dns_servers_dnsmasq-4f30a9957e8de732.yaml @@ -0,0 +1,11 @@ +--- +features: + - Allow to populate the DNS servers setting of + dnsmasq. This is optional, but if + ``dnsmasq_dns_servers``setting is set, it adds a + ``dhcp-option=6,dnsmasq_dns_servers`` to the + generated dnsmasq configuration for bifrost. +other: + - When configuring the ``dnsmasq_dns_servers`` setting, + several nameservers can be specified, separated by + commas.