module-tinc/manifests/vpn_net/host.pp

25 lines
585 B
ObjectPascal
Raw Normal View History

2010-10-22 23:15:28 +02:00
# $name => Name of the host we want to connect to
define tinc::vpn_net::host(
$ensure = present,
$source = absent,
$source_is_prefix = false,
$vpn_net
){
2010-10-23 01:29:49 +02:00
nametinc = regsubst("${name}",'[._-]+','','G')
2010-10-22 23:15:28 +02:00
2010-10-23 01:29:49 +02:00
file { "/etc/tinc/${vpn_net}/hosts/${nametinc}":
2010-10-22 23:15:28 +02:00
ensure => $ensure,
source => $source ? {
'absent' => "puppet:///modules/site-tinc/hosts/${vpn_net}/${name}",
default => $source_is_prefix ? {
false => $source,
default => "${source}/${name}"
}
},
notify => Service[tinc],
owner => root, group => 0, mode => 0600;
}
}