Skip to content

Commit 9663886

Browse files
committedDec 28, 2017
replace sysv with init and add provider option to tun service resource
1 parent 64b39a7 commit 9663886

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed
 

‎README.markdown

+5-5
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ For information on stunnel global options, see [the stunnel documentation](https
277277
### install\_service ###
278278

279279
Specify whether you want this stunnel Puppet module to install stunnel as a
280-
system service. Installing as a service currently places a sysvinit style
280+
system service. Installing as a service currently places a initinit style
281281
initscript for each tunnel inside of /etc/init.d/stunnel-\<name\>.
282282

283283
install_service => false,
@@ -291,15 +291,15 @@ will be removed.
291291

292292
### service\_init\_system ###
293293

294-
Specify which init system will be managing the service. If set to 'sysv' then
295-
a sysvinit style initscript for each tunnel will be placed inside of
294+
Specify which init system will be managing the service. If set to 'init' then
295+
a initinit style initscript for each tunnel will be placed inside of
296296
/etc/init.d/stunnel-\<name\>. If set to 'systemd' then a systemd service unit
297297
config will be placed in /etc/systemd/system/stunnel-\<name\>.service.
298298

299-
service_init_system => 'sysv',
299+
service_init_system => 'init',
300300
service_init_system => 'systemd',
301301

302-
This attribute is optional and defaults to `sysv`.
302+
This attribute is optional and defaults to `init`.
303303

304304
### options ###
305305

‎manifests/data.pp

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
if versioncmp($::operatingsystemmajrelease, '7') >= 0 {
2121
$service_init_system = 'systemd'
2222
} else {
23-
$service_init_system = 'sysv'
23+
$service_init_system = 'init'
2424
}
2525
}
2626
/Debian/: {
@@ -40,7 +40,7 @@
4040
($::operatingsystem == 'Debian' and versioncmp($::operatingsystemrelease, '8.0') >= 0) {
4141
$service_init_system = 'systemd'
4242
} else {
43-
$service_init_system = 'sysv'
43+
$service_init_system = 'init'
4444
}
4545
}
4646

‎manifests/tun.pp

+6-5
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959
# Defaults to true
6060
#
6161
# [*service_init_system*]
62-
# Which init system will be managing this service. Valid values are 'sysv'
62+
# Which init system will be managing this service. Valid values are 'init'
6363
# and 'systemd'.
64-
# Defaults to 'sysv'
64+
# Defaults to 'init'
6565
#
6666
define stunnel::tun (
6767
$accept,
@@ -127,8 +127,8 @@
127127
'UNSET' => $::stunnel::data::service_init_system,
128128
default => $service_init_system,
129129
}
130-
validate_re( $service_init_system_real, '^(sysv|systemd)$',
131-
'$service_init_system must be either \'sysv\' or \'systemd\'')
130+
validate_re( $service_init_system_real, '^(init|systemd)$',
131+
'$service_init_system must be either \'init\' or \'systemd\'')
132132

133133
$pid = "${stunnel::data::pid_dir}/stunnel-${name}.pid"
134134
$output_r = $output ? {
@@ -155,7 +155,7 @@
155155
} else {
156156
$initscript_ensure = 'absent'
157157
}
158-
if $service_init_system_real == 'sysv' {
158+
if $service_init_system_real == 'init' {
159159
$initscript_file = "/etc/init.d/stunnel-${name}"
160160
file { $initscript_file:
161161
ensure => $initscript_ensure,
@@ -193,6 +193,7 @@
193193
service { "stunnel-${name}":
194194
ensure => $service_ensure_real,
195195
enable => $service_enable,
196+
provider => $service_init_system_real,
196197
require => $service_require,
197198
before => $service_before,
198199
subscribe => File[$config_file],

‎spec/defines/stunnel_tun_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
end
2424
end
2525

26-
it 'should contain a sysv init script' do
26+
it 'should contain a init init script' do
2727
should contain_file('/etc/init.d/stunnel-my-tunnel').with_ensure('present')
2828
end
2929

0 commit comments

Comments
 (0)
Please sign in to comment.