Fixed dhcp::server for CentOS 6.
This commit is contained in:
parent
3effb702f7
commit
f9995ad7a1
1 changed files with 29 additions and 10 deletions
|
@ -1,6 +1,28 @@
|
|||
|
||||
class dhcp::server::common {
|
||||
|
||||
case $::operatingsystem {
|
||||
"centos": {
|
||||
case $::operatingsystemrelease {
|
||||
/[45]\.[0-9]/: {
|
||||
$confdir = "/etc"
|
||||
}
|
||||
default: {
|
||||
$confdir = "/etc/dhcp"
|
||||
}
|
||||
}
|
||||
}
|
||||
"debian","ubuntu": {
|
||||
$confdir = "/etc/dhcp3"
|
||||
}
|
||||
"fedora": {
|
||||
$confdir = "/etc/dhcp"
|
||||
}
|
||||
default: {
|
||||
$confdir = "/etc"
|
||||
}
|
||||
}
|
||||
|
||||
package { "dhcp":
|
||||
name => $operatingsystem ? {
|
||||
Debian => "dhcp3-server",
|
||||
|
@ -73,12 +95,8 @@ class dhcp::server::common {
|
|||
|
||||
class dhcp::server inherits dhcp::server::common {
|
||||
|
||||
file { "/etc/dhcpd.conf":
|
||||
name => $operatingsystem ? {
|
||||
debian => "/etc/dhcp3/dhcpd.conf",
|
||||
ubuntu => "/etc/dhcp3/dhcpd.conf",
|
||||
default => "/etc/dhcpd.conf",
|
||||
},
|
||||
file { "dhcpd.conf":
|
||||
name => "${confdir}/dhcpd.conf",
|
||||
ensure => present,
|
||||
source => [ "puppet:///files/dhcp/dhcpd.conf.${fqdn}",
|
||||
"puppet:///files/dhcp/dhcpd.conf", ],
|
||||
|
@ -110,8 +128,9 @@ class dhcp::server::ldap inherits dhcp::server::common {
|
|||
},
|
||||
}
|
||||
|
||||
file { "/etc/dhcpd.conf.in":
|
||||
file { "dhcpd.conf.in":
|
||||
ensure => present,
|
||||
name => "${confdir}/dhcpd.conf.in",
|
||||
source => [ "puppet:///files/dhcp/dhcpd.conf.in.${hostname}",
|
||||
"puppet:///files/dhcp/dhcpd.conf.in", ],
|
||||
mode => "0644",
|
||||
|
@ -125,10 +144,10 @@ class dhcp::server::ldap inherits dhcp::server::common {
|
|||
|
||||
exec { "generate-dhcp-conf":
|
||||
path => "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin",
|
||||
command => "dhcpdump.py /etc/dhcpd.conf.in* > /etc/dhcpd.conf",
|
||||
unless => "dhcpdump.py /etc/dhcpd.conf.in* | diff /etc/dhcpd.conf -",
|
||||
command => "dhcpdump.py ${confdir}/dhcpd.conf.in* > ${confdir}/dhcpd.conf",
|
||||
unless => "dhcpdump.py ${confdir}/dhcpd.conf.in* | diff ${confdir}/dhcpd.conf -",
|
||||
require => [
|
||||
File["/etc/dhcpd.conf.in"],
|
||||
File["dhcpd.conf.in"],
|
||||
File["/usr/local/sbin/dhcpdump.py"],
|
||||
Class["python"],
|
||||
Class["ldap::client"],
|
||||
|
|
Loading…
Add table
Reference in a new issue