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 {
|
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":
|
package { "dhcp":
|
||||||
name => $operatingsystem ? {
|
name => $operatingsystem ? {
|
||||||
Debian => "dhcp3-server",
|
Debian => "dhcp3-server",
|
||||||
|
@ -73,12 +95,8 @@ class dhcp::server::common {
|
||||||
|
|
||||||
class dhcp::server inherits dhcp::server::common {
|
class dhcp::server inherits dhcp::server::common {
|
||||||
|
|
||||||
file { "/etc/dhcpd.conf":
|
file { "dhcpd.conf":
|
||||||
name => $operatingsystem ? {
|
name => "${confdir}/dhcpd.conf",
|
||||||
debian => "/etc/dhcp3/dhcpd.conf",
|
|
||||||
ubuntu => "/etc/dhcp3/dhcpd.conf",
|
|
||||||
default => "/etc/dhcpd.conf",
|
|
||||||
},
|
|
||||||
ensure => present,
|
ensure => present,
|
||||||
source => [ "puppet:///files/dhcp/dhcpd.conf.${fqdn}",
|
source => [ "puppet:///files/dhcp/dhcpd.conf.${fqdn}",
|
||||||
"puppet:///files/dhcp/dhcpd.conf", ],
|
"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,
|
ensure => present,
|
||||||
|
name => "${confdir}/dhcpd.conf.in",
|
||||||
source => [ "puppet:///files/dhcp/dhcpd.conf.in.${hostname}",
|
source => [ "puppet:///files/dhcp/dhcpd.conf.in.${hostname}",
|
||||||
"puppet:///files/dhcp/dhcpd.conf.in", ],
|
"puppet:///files/dhcp/dhcpd.conf.in", ],
|
||||||
mode => "0644",
|
mode => "0644",
|
||||||
|
@ -125,10 +144,10 @@ class dhcp::server::ldap inherits dhcp::server::common {
|
||||||
|
|
||||||
exec { "generate-dhcp-conf":
|
exec { "generate-dhcp-conf":
|
||||||
path => "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin",
|
path => "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin",
|
||||||
command => "dhcpdump.py /etc/dhcpd.conf.in* > /etc/dhcpd.conf",
|
command => "dhcpdump.py ${confdir}/dhcpd.conf.in* > ${confdir}/dhcpd.conf",
|
||||||
unless => "dhcpdump.py /etc/dhcpd.conf.in* | diff /etc/dhcpd.conf -",
|
unless => "dhcpdump.py ${confdir}/dhcpd.conf.in* | diff ${confdir}/dhcpd.conf -",
|
||||||
require => [
|
require => [
|
||||||
File["/etc/dhcpd.conf.in"],
|
File["dhcpd.conf.in"],
|
||||||
File["/usr/local/sbin/dhcpdump.py"],
|
File["/usr/local/sbin/dhcpdump.py"],
|
||||||
Class["python"],
|
Class["python"],
|
||||||
Class["ldap::client"],
|
Class["ldap::client"],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue