aboutsummaryrefslogtreecommitdiff
path: root/manifests/definitions
diff options
context:
space:
mode:
authorMarc Fournier <marc.fournier@camptocamp.com>2011-11-15 13:17:30 +0100
committerMarc Fournier <marc.fournier@camptocamp.com>2011-11-15 13:17:30 +0100
commit5f4a22d6775fc091124c95bbb0b891bf95e6043c (patch)
tree8e72cf49cb70d9f88cd31dff946f5785f0fb8721 /manifests/definitions
parent69f887dee39d13f52b7b228fa49e54bdd0454c3b (diff)
downloadpuppet-dhcp-5f4a22d6775fc091124c95bbb0b891bf95e6043c.tar.gz
puppet-dhcp-5f4a22d6775fc091124c95bbb0b891bf95e6043c.tar.bz2
file renaming to be compliant with recommended module structure.
Diffstat (limited to 'manifests/definitions')
-rw-r--r--manifests/definitions/dhcp-host.pp20
-rw-r--r--manifests/definitions/dhcp-shared-network.pp22
-rw-r--r--manifests/definitions/dhcp-subnet.pp76
3 files changed, 0 insertions, 118 deletions
diff --git a/manifests/definitions/dhcp-host.pp b/manifests/definitions/dhcp-host.pp
deleted file mode 100644
index 160df63..0000000
--- a/manifests/definitions/dhcp-host.pp
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
-
-= Definition: dhcp::host
-Create dhcp configuration for a host
-
-Arguments:
- *$mac*: host MAC address (mandatory)
- *$subnet*: subnet in which we want to add this host
- *$fixed_address*: host fixed address (if not set, takes $name)
-
-*/
-define dhcp::host($ensure=present,$mac,$subnet,$fixed_address=false, $options=false) {
- include dhcp::params
- common::concatfilepart {"dhcp.host.$name":
- ensure => $ensure,
- notify => Service["dhcpd"],
- file => "${dhcp::params::config_dir}/hosts.d/${subnet}.conf",
- content => template("dhcp/host.conf.erb"),
- }
-}
diff --git a/manifests/definitions/dhcp-shared-network.pp b/manifests/definitions/dhcp-shared-network.pp
deleted file mode 100644
index 9e1e779..0000000
--- a/manifests/definitions/dhcp-shared-network.pp
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
-
-== Definition: dhcp::shared-network
-Creates a shared-network
-
-Arguments:
- *$subnets* : subnet list to be included in the shared-network
-
-Warnings:
-- subnets must exists
-- subnets must have $is_shared set to true (default is false)
-
-*/
-define dhcp::shared-network($ensure=present, $subnets=[]) {
- include dhcp::params
- common::concatfilepart {"shared-${name}":
- ensure => $ensure,
- file => "${dhcp::params::config_dir}/dhcpd.conf",
- content => template("dhcp/shared-network.erb"),
- require => Dhcp::Subnet[$subnets],
- }
-}
diff --git a/manifests/definitions/dhcp-subnet.pp b/manifests/definitions/dhcp-subnet.pp
deleted file mode 100644
index c0f865b..0000000
--- a/manifests/definitions/dhcp-subnet.pp
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-
-= Definition: dhcp::subnet
-Creates a subnet
-
-Arguments:
- *$broadcast* : subnet broadcast (mandatory)
- *$netmask* : subnet netmask (if not set, takes eth0 netmask)
- *$routers* : subnet routers (array) (if not set, takes eth0 IP)
- *$subnet_mask* : netmask sent to dhcp guests (if not set, takes $netmask, or netmask_eth0)
- *$domain_name* : subnet domain name (if not set, takes server domain)
- *$other_opts* : any other DHCPD option, as an array
- *$is_shared* : whether it's part of a shared network or not. Default: false
-
-Example:
-
-node "dhcp.domain.ltd" {
- $dhcpd_domain_name = 'domain.ltd'
- $dhcpd_dns_servers = '10.27.21.1, 10.26.21.1'
- include dhcp
-
- dhcp::subnet {"10.27.20.0":
- ensure => present,
- broadcast => "10.27.20.255",
- other_opts => ['filename "pxelinux.0";', 'next-server 10.27.10.1;'],
- }
-}
-*/
-define dhcp::subnet(
- $ensure=present,
- $broadcast,
- $netmask=false,
- $routers=false,
- $subnet_mask=false,
- $domain_name=false,
- $other_opts=false,
- $is_shared=false) {
- include dhcp::params
-
- $to_include = "${dhcp::params::config_dir}/hosts.d/${name}.conf"
-
- file {"${dhcp::params::config_dir}/subnets/${name}.conf":
- ensure => $ensure,
- owner => root,
- group => root,
- content => template("dhcp/subnet.conf.erb"),
- notify => Service["dhcpd"],
- }
-
- if ! $is_shared {
- common::concatfilepart {"dhcp.${name}":
- file => "${dhcp::params::config_dir}/dhcpd.conf",
- ensure => $ensure,
- content => "include \"${dhcp::params::config_dir}/subnets/${name}.conf\";\n",
- }
- } else {
- common::concatfilepart {"dhcp.${name}":
- file => "${dhcp::params::config_dir}/dhcpd.conf",
- ensure => absent,
- content => "include \"${dhcp::params::config_dir}/subnets/${name}.conf\";\n",
- }
-
- }
-
- common::concatfilepart {"subnet.${name}.hosts":
- file => "${dhcp::params::config_dir}/dhcpd.conf",
- ensure => $ensure,
- content => "include \"${dhcp::params::config_dir}/hosts.d/${name}.conf\";\n",
- }
-
- common::concatfilepart {"00.dhcp.${name}.base":
- file => $to_include,
- ensure => $ensure,
- content => "# File managed by puppet\n",
- }
-}