Skip to content

Instantly share code, notes, and snippets.

@frimik
Created April 21, 2012 22:25
Show Gist options
  • Select an option

  • Save frimik/2439983 to your computer and use it in GitHub Desktop.

Select an option

Save frimik/2439983 to your computer and use it in GitHub Desktop.
dhcp::subnet support snippet
class my_dhcp::example {
$subnets = {
'the main subnet' => {
network => '10.0.0.0',
netmask => '255.255.255.0',
gateway => '10.0.0.1',
domain => 'example.com',
parameters => [ ],
pools => {
'Unknown clients get this pool.' => {
nameservers => [
'bogus.example.com',
],
parameters => [
'max-lease-time 300',
'allow unknown-clients',
],
ranges => [
'10.0.0.200 10.0.0.253',
],
},
'Known clients get this pool.' => {
nameservers => [
'ns1.example.com',
'ns2.example.com',
],
parameters => [
'max-lease-time 28800',
'deny unknown-clients',
],
ranges => [
'10.0.0.5 10.0.0.199',
],
},
},
},
}
# create all the subnets:
create_resources('dhcp::subnet', $subnets)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment