Browse code

Add dhcp server option to dnsmasq for baremetal

This sets the dns option for baremetal deploy clients.
this is useful for clients who may require external access
during the deployment process.

Change-Id: Ibe680d2acaad826e4868223ebfd1f112d7796662
Authored-by: Chris Krelle <nobodycam@gmail.com>

Chris Krelle authored on 2013/02/04 08:48:43
Showing 2 changed files
... ...
@@ -90,6 +90,9 @@ else
90 90
     BM_DNSMASQ_RANGE=${BM_DNSMASQ_RANGE:-}
91 91
 fi
92 92
 
93
+# BM_DNSMASQ_DNS provide dns server to bootstrap clients
94
+BM_DNSMASQ_DNS=${BM_DNSMASQ_DNS:-}
95
+
93 96
 # BM_FIRST_MAC *must* be set to the MAC address of the node you will boot.
94 97
 #              This is passed to dnsmasq along with the kernel/ramdisk to
95 98
 #              deploy via PXE.
... ...
@@ -1285,8 +1285,8 @@ if is_service_enabled nova && is_baremetal; then
1285 1285
     sudo pkill dnsmasq || true
1286 1286
     sudo dnsmasq --conf-file= --port=0 --enable-tftp --tftp-root=/tftpboot \
1287 1287
         --dhcp-boot=pxelinux.0 --bind-interfaces --pid-file=/var/run/dnsmasq.pid \
1288
-        --interface=$BM_DNSMASQ_IFACE --dhcp-range=$BM_DNSMASQ_RANGE
1289
-
1288
+        --interface=$BM_DNSMASQ_IFACE --dhcp-range=$BM_DNSMASQ_RANGE \
1289
+        ${$BM_DNSMASQ_DNS:+--dhcp-option=option:dns-server,$BM_DNSMASQ_DNS}
1290 1290
     # ensure callback daemon is running
1291 1291
     sudo pkill nova-baremetal-deploy-helper || true
1292 1292
     screen_it baremetal "nova-baremetal-deploy-helper"