From b4df04f4a3c0f10be3927c2eaddab4f690b68398 Mon Sep 17 00:00:00 2001 From: Yolanda Robla Date: Mon, 25 Jan 2016 13:16:00 +0100 Subject: [PATCH] Add dns_servers feature to bifrost dnsmasq This will allow to specify external nameservers to dnsmasq configuration. Change-Id: I4712588698269aa6ab333034be72e540faba3ec1 --- playbooks/inventory/group_vars/localhost | 5 +++++ .../roles/bifrost-ironic-install/defaults/main.yml | 4 ++++ .../bifrost-ironic-install/templates/dnsmasq.conf.j2 | 4 ++++ ...populate_dns_servers_dnsmasq-4f30a9957e8de732.yaml | 11 +++++++++++ 4 files changed, 24 insertions(+) create mode 100644 releasenotes/notes/populate_dns_servers_dnsmasq-4f30a9957e8de732.yaml 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.