Import rest of modules.
This commit is contained in:
parent
02fa10f33c
commit
3f225ced9b
39 changed files with 2056 additions and 0 deletions
75
dhcp/manifests/init.pp
Normal file
75
dhcp/manifests/init.pp
Normal file
|
@ -0,0 +1,75 @@
|
|||
|
||||
class dhcp::server {
|
||||
|
||||
package { "dhcp":
|
||||
name => $operatingsystem ? {
|
||||
OpenBSD => "isc-dhcp-server",
|
||||
default => "dhcp",
|
||||
},
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
file { "/usr/local/sbin/dhcpdump.py":
|
||||
ensure => present,
|
||||
source => "puppet:///dhcp/dhcpdump.py",
|
||||
mode => 0755,
|
||||
owner => root,
|
||||
group => $operatingsystem ? {
|
||||
OpenBSD => wheel,
|
||||
default => root,
|
||||
},
|
||||
}
|
||||
|
||||
file { "/etc/dhcpd.conf.in":
|
||||
ensure => present,
|
||||
source => [ "puppet:///files/dhcp/dhcpd.conf.in.${hostname}",
|
||||
"puppet:///files/dhcp/dhcpd.conf.in", ],
|
||||
mode => 0644,
|
||||
owner => root,
|
||||
group => $operatingsystem ? {
|
||||
OpenBSD => wheel,
|
||||
default => root,
|
||||
},
|
||||
require => Package["dhcp"],
|
||||
}
|
||||
|
||||
file { "dhcpd.leases":
|
||||
name => $operatingsystem ? {
|
||||
OpenBSD => "/var/db/dhcpd.leases",
|
||||
default => "/var/lib/dhcpd/dhcpd.leases",
|
||||
},
|
||||
ensure => present,
|
||||
owner => root,
|
||||
group => $operatingsystem ? {
|
||||
OpenBSD => wheel,
|
||||
default => root,
|
||||
},
|
||||
require => Package["dhcp"],
|
||||
before => Service["dhcpd"],
|
||||
}
|
||||
|
||||
service { "dhcpd":
|
||||
ensure => running,
|
||||
enable => true,
|
||||
require => Package["dhcp"],
|
||||
}
|
||||
case $operatingsystem {
|
||||
OpenBSD: {
|
||||
Service["dhcpd"] {
|
||||
name => "isc-dhcpd",
|
||||
binary => "/usr/local/sbin/dhcpd",
|
||||
start => "/usr/local/sbin/dhcpd > /dev/null",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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",
|
||||
onlyif => "! dhcpdump.py /etc/dhcpd.conf.in* | diff /etc/dhcpd.conf -",
|
||||
require => [ File["/etc/dhcpd.conf.in"],
|
||||
File["/usr/local/sbin/dhcpdump.py"], ],
|
||||
notify => Service["dhcpd"],
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue