aboutsummaryrefslogtreecommitdiff
path: root/manifests/definitions/dhcp-subnet.pp
blob: 46c55ae50570f51b9244cbaca2d7f50344f59946 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
define dhcp::subnet(
  $ensure=present,
  $bcast,
  $dns,
  $netmask=false,
  $domain_name=false,
  $inc=false,
  $routeurs=false,
  $netbios_dns=false,
  $subnet_mask=false,
  $other_opt=false,
  $deny=false) {
  include dhcp::variables

  if $inc {
    $to_inc = "${dhcp::variables::config_dir}/hosts.d/${name}.conf"
  }

  file {"${dhcp::variables::config_dir}/subnets/${name}.conf":
    ensure => $ensure,
    owner  => root,
    group  => root,
    content => template("dhcp/subnet.conf.erb"),
    notify  => Service["dhcpd"],
  }
  
  common::concatfilepart {"${name}":
    file => "${dhcp::variables::config_dir}/dhcpd.conf",
    ensure => $ensure,
    content => "include \"${dhcp::variables::config_dir}/subnets/${name}.conf\";\n",
  }

}