this registration is only for non systemd systems
This commit is contained in:
parent
06aa8b9c4e
commit
6aa488e815
2 changed files with 29 additions and 21 deletions
|
@ -13,6 +13,9 @@ class tinc::centos inherits tinc::base {
|
||||||
ensure => undef,
|
ensure => undef,
|
||||||
enable => false,
|
enable => false,
|
||||||
}
|
}
|
||||||
|
Concat['/etc/tinc/nets.boot']{
|
||||||
|
ensure => 'absent',
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
file {
|
file {
|
||||||
'/etc/sysconfig/tinc' :
|
'/etc/sysconfig/tinc' :
|
||||||
|
|
|
@ -16,14 +16,29 @@ define tinc::instance(
|
||||||
$fqdn_tinc = regsubst($::fqdn,'[._-]+','','G')
|
$fqdn_tinc = regsubst($::fqdn,'[._-]+','','G')
|
||||||
$tinc_config = "/etc/tinc/${name}/tinc.conf"
|
$tinc_config = "/etc/tinc/${name}/tinc.conf"
|
||||||
|
|
||||||
|
# register net for bootup?
|
||||||
|
$boot_ensure = $ensure ? {
|
||||||
|
'present' => $connect_on_boot ? {
|
||||||
|
true => 'present',
|
||||||
|
default => 'absent'
|
||||||
|
},
|
||||||
|
default => 'absent'
|
||||||
|
}
|
||||||
|
|
||||||
# which service do we have to manage?
|
# which service do we have to manage?
|
||||||
if $tinc::uses_systemd {
|
if $tinc::uses_systemd {
|
||||||
$service_name = "tincd@${name}"
|
$service_name = "tincd@${name}"
|
||||||
service{$service_name: }
|
service{$service_name: }
|
||||||
|
|
||||||
if $ensure == 'present' {
|
if $ensure == 'present' {
|
||||||
Service[$service_name]{
|
# if we don't want to start
|
||||||
ensure => running,
|
# on boot, we don't need to
|
||||||
enable => true,
|
# manage that part of the service
|
||||||
|
if $boot_ensure == 'present' {
|
||||||
|
Service[$service_name]{
|
||||||
|
ensure => running,
|
||||||
|
enable => true,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Service[$service_name]{
|
Service[$service_name]{
|
||||||
|
@ -34,26 +49,16 @@ define tinc::instance(
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$service_name = 'tinc'
|
$service_name = 'tinc'
|
||||||
|
# only relevant for non-systemd systems
|
||||||
|
concat::fragment{"tinc_net_${name}":
|
||||||
|
ensure => $boot_ensure,
|
||||||
|
line => "${name}\n",
|
||||||
|
target => '/etc/tinc/nets.boot',
|
||||||
|
require => File['/etc/tinc/nets.boot'],
|
||||||
|
notify => Service[$service_name],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# register net for bootup
|
|
||||||
$boot_ensure = $ensure ? {
|
|
||||||
'present' => $connect_on_boot ? {
|
|
||||||
true => 'present',
|
|
||||||
default => 'absent'
|
|
||||||
},
|
|
||||||
default => 'absent'
|
|
||||||
}
|
|
||||||
concat::fragment{"tinc_net_${name}":
|
|
||||||
ensure => $boot_ensure,
|
|
||||||
line => "${name}\n",
|
|
||||||
target => '/etc/tinc/nets.boot',
|
|
||||||
require => File['/etc/tinc/nets.boot'],
|
|
||||||
notify => Service[$service_name],
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
file{"/etc/tinc/${name}":
|
file{"/etc/tinc/${name}":
|
||||||
require => Package['tinc'],
|
require => Package['tinc'],
|
||||||
owner => root,
|
owner => root,
|
||||||
|
|
Loading…
Reference in a new issue