*/
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"],
}
}
*/
class dhcp::server::base {
+
include dhcp::params
+ include concat::setup
+
package {"dhcp-server":
ensure => present,
name => $dhcp::params::srv_dhcpd,
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"],
}
*/
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'),
}
*/
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],
}
$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,
}
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",
}
}