aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorMathieu Bornoz <mathieu.bornoz@camptocamp.com>2012-08-02 09:30:21 +0200
committerMathieu Bornoz <mathieu.bornoz@camptocamp.com>2012-08-02 09:30:21 +0200
commit536a24852925104df8b9becfcac9d17ac999a5f4 (patch)
treedc559110c95876c9f48ba81c0bc89cd43cad8737 /manifests
parent5f4a22d6775fc091124c95bbb0b891bf95e6043c (diff)
downloadpuppet-dhcp-536a24852925104df8b9becfcac9d17ac999a5f4.tar.gz
puppet-dhcp-536a24852925104df8b9becfcac9d17ac999a5f4.tar.bz2
switch from common::concatfilepart to concat[1]
[1] https://github.com/camptocamp/puppet-concat
Diffstat (limited to 'manifests')
-rw-r--r--manifests/host.pp8
-rw-r--r--manifests/server/base.pp13
-rw-r--r--manifests/server/debian.pp2
-rw-r--r--manifests/shared-network.pp4
-rw-r--r--manifests/subnet.pp30
5 files changed, 35 insertions, 22 deletions
diff --git a/manifests/host.pp b/manifests/host.pp
index 160df63..d946ae9 100644
--- a/manifests/host.pp
+++ b/manifests/host.pp
@@ -11,10 +11,10 @@ Arguments:
*/
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",
+ concat::fragment {"dhcp.host.$name":
+ ensure => $ensure,
+ target => "${dhcp::params::config_dir}/hosts.d/${subnet}.conf",
content => template("dhcp/host.conf.erb"),
+ notify => Service["dhcpd"],
}
}
diff --git a/manifests/server/base.pp b/manifests/server/base.pp
index 1725b36..53cbd70 100644
--- a/manifests/server/base.pp
+++ b/manifests/server/base.pp
@@ -7,7 +7,10 @@ This class should be inherited in dhcp::server::$operatingsystem.
*/
class dhcp::server::base {
+
include dhcp::params
+ include concat::setup
+
package {"dhcp-server":
ensure => present,
name => $dhcp::params::srv_dhcpd,
@@ -20,9 +23,15 @@ class dhcp::server::base {
require => Package["dhcp-server"],
}
- common::concatfilepart {"00.dhcp.server.base":
- file => "${dhcp::params::config_dir}/dhcpd.conf",
+ concat {"${dhcp::params::config_dir}/dhcpd.conf":
+ owner => root,
+ group => root,
+ mode => '0644',
+ }
+
+ concat::fragment {"00.dhcp.server.base":
ensure => present,
+ target => "${dhcp::params::config_dir}/dhcpd.conf",
require => Package["dhcp-server"],
notify => Service["dhcpd"],
}
diff --git a/manifests/server/debian.pp b/manifests/server/debian.pp
index 9762384..3cc7508 100644
--- a/manifests/server/debian.pp
+++ b/manifests/server/debian.pp
@@ -8,7 +8,7 @@ This class should not be included as is, please include "dhcp::server" instead.
*/
class dhcp::server::debian inherits dhcp::server::base {
- Common::Concatfilepart["00.dhcp.server.base"] {
+ Concat::Fragment["00.dhcp.server.base"] {
content => template('dhcp/dhcpd.conf.debian.erb'),
}
diff --git a/manifests/shared-network.pp b/manifests/shared-network.pp
index 9e1e779..2154d37 100644
--- a/manifests/shared-network.pp
+++ b/manifests/shared-network.pp
@@ -13,9 +13,9 @@ Warnings:
*/
define dhcp::shared-network($ensure=present, $subnets=[]) {
include dhcp::params
- common::concatfilepart {"shared-${name}":
+ concat::fragment {"shared-${name}":
ensure => $ensure,
- file => "${dhcp::params::config_dir}/dhcpd.conf",
+ target => "${dhcp::params::config_dir}/dhcpd.conf",
content => template("dhcp/shared-network.erb"),
require => Dhcp::Subnet[$subnets],
}
diff --git a/manifests/subnet.pp b/manifests/subnet.pp
index c0f865b..15afd53 100644
--- a/manifests/subnet.pp
+++ b/manifests/subnet.pp
@@ -37,7 +37,11 @@ define dhcp::subnet(
$is_shared=false) {
include dhcp::params
- $to_include = "${dhcp::params::config_dir}/hosts.d/${name}.conf"
+ concat {"${dhcp::params::config_dir}/hosts.d/${name}.conf":
+ owner => root,
+ group => root,
+ mode => '0644',
+ }
file {"${dhcp::params::config_dir}/subnets/${name}.conf":
ensure => $ensure,
@@ -48,29 +52,29 @@ define dhcp::subnet(
}
if ! $is_shared {
- common::concatfilepart {"dhcp.${name}":
- file => "${dhcp::params::config_dir}/dhcpd.conf",
- ensure => $ensure,
+ concat::fragment {"dhcp.${name}":
+ ensure => $ensure,
+ target => "${dhcp::params::config_dir}/dhcpd.conf",
content => "include \"${dhcp::params::config_dir}/subnets/${name}.conf\";\n",
}
} else {
- common::concatfilepart {"dhcp.${name}":
- file => "${dhcp::params::config_dir}/dhcpd.conf",
- ensure => absent,
+ concat::fragment {"dhcp.${name}":
+ ensure => absent,
+ target => "${dhcp::params::config_dir}/dhcpd.conf",
content => "include \"${dhcp::params::config_dir}/subnets/${name}.conf\";\n",
}
}
- common::concatfilepart {"subnet.${name}.hosts":
- file => "${dhcp::params::config_dir}/dhcpd.conf",
- ensure => $ensure,
+ concat::fragment {"subnet.${name}.hosts":
+ ensure => $ensure,
+ target => "${dhcp::params::config_dir}/dhcpd.conf",
content => "include \"${dhcp::params::config_dir}/hosts.d/${name}.conf\";\n",
}
- common::concatfilepart {"00.dhcp.${name}.base":
- file => $to_include,
- ensure => $ensure,
+ concat::fragment {"00.dhcp.${name}.base":
+ ensure => $ensure,
+ target => "${dhcp::params::config_dir}/hosts.d/${name}.conf",
content => "# File managed by puppet\n",
}
}