Browse Source

Update dhclient.conf to be in sync across all OSes

After finding some puppet jobs were failing on CentOS it was found the
DHCP server for osic and ovh were passing extra settings.

As a results, we also noticed our dhclient.conf was not in sync around
all of our images.  So, this patch attemps to fix both issues.

Change-Id: I2415f7e42a9d5931589192b7d78423941e02b076
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Paul Belanger 2 years ago
parent
commit
dffe3580c1
No account linked to committer's email address
3 changed files with 16 additions and 9 deletions
  1. 4
    6
      files/dhclient.conf.debian
  2. 7
    0
      files/dhclient.conf.redhat
  3. 5
    3
      manifests/init.pp

+ 4
- 6
files/dhclient.conf.debian View File

@@ -1,9 +1,7 @@
1 1
 option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
2 2
 send host-name "<hostname>";
3
-request subnet-mask, broadcast-address, time-offset, routers,
4
-	domain-name, domain-name-servers, domain-search, host-name,
5
-	netbios-name-servers, netbios-scope, interface-mtu,
6
-	rfc3442-classless-static-routes, ntp-servers,
7
-	dhcp6.domain-search, dhcp6.fqdn,
8
-	dhcp6.name-servers, dhcp6.sntp-servers;
3
+request subnet-mask, broadcast-address, routers,
4
+	interface-mtu, rfc3442-classless-static-routes;
9 5
 supersede domain-name-servers 127.0.0.1;
6
+supersede domain-search "";
7
+supersede domain-name "";

+ 7
- 0
files/dhclient.conf.redhat View File

@@ -0,0 +1,7 @@
1
+option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
2
+send host-name "<hostname>";
3
+request subnet-mask, broadcast-address, routers,
4
+	interface-mtu, rfc3442-classless-static-routes;
5
+supersede domain-name-servers 127.0.0.1;
6
+supersede domain-search "";
7
+supersede domain-name "";

+ 5
- 3
manifests/init.pp View File

@@ -57,9 +57,11 @@ class unbound (
57 57
       ensure  => present,
58 58
     }
59 59
 
60
-    # HPCloud uses dhclient; tell dhclient to use our nameserver instead.
61
-    exec { '/usr/bin/printf "\nsupersede domain-name-servers 127.0.0.1;\n" >> /etc/dhcp/dhclient-eth0.conf':
62
-        unless => '/bin/grep -q "supersede domain-name-servers" /etc/dhcp/dhclient-eth0.conf'
60
+    file { '/etc/dhcp/dhclient-eth0.conf':
61
+      source => 'puppet:///modules/unbound/dhclient.conf.redhat',
62
+      owner  => 'root',
63
+      group  => 'root',
64
+      mode   => '0644',
63 65
     }
64 66
   }
65 67
 

Loading…
Cancel
Save