Skip to content

Commit ffb4d56

Browse files
author
Helen Campbell
committed
Work for SLES 12 compatibility
1 parent 9937d96 commit ffb4d56

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

README.markdown

+4
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,10 @@ Tells Puppet whether to manage the NTP service. Valid options: 'true' or 'false'
302302

303303
Tells Puppet what NTP service to manage. Valid options: string. Default value: varies by operating system
304304

305+
####`service_provider`
306+
307+
Tells Puppet which service provider to use for NTP. Valid options: string. Default value: 'undef'
308+
305309
####`stepout`
306310

307311
Tells puppet to change stepout. Applies only if `tinker` value is 'true'. Valid options: unsigned shortint digit. Default value: undef.

manifests/config.pp

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Private Class
22
class ntp::config inherits ntp {
33

4+
#Due to the following file overriding NTPs specific config on SLES 12 we ensure the file is absent for SLES 12 setups.
5+
if $::operatingsystem == 'SLES' and $::operatingsystemmajrelease == '12' {
6+
file { '/var/run/ntp/servers-netconfig':
7+
ensure => 'absent'
8+
}
9+
}
10+
411
if $ntp::keys_enable {
512
case $ntp::config_dir {
613
'/', '/etc', undef: {}

manifests/init.pp

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
$service_ensure = $ntp::params::service_ensure,
3535
$service_manage = $ntp::params::service_manage,
3636
$service_name = $ntp::params::service_name,
37+
$service_provider = $ntp::params::service_provider,
3738
$stepout = $ntp::params::stepout,
3839
$tinker = $ntp::params::tinker,
3940
$tos = $ntp::params::tos,

manifests/params.pp

+2
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@
156156
$service_name = 'ntpd'
157157
$keys_file = '/etc/ntp.keys'
158158
$package_name = $default_package_name
159+
#SLES12 uses sytemd as its service provider, hence why we hardcode it here.
160+
$service_provider = 'systemd'
159161
}
160162
default: {
161163
fail("The ${module_name} module is not supported on an ${::operatingsystem} ${::operatingsystemmajrelease} distribution.")

manifests/service.pp

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
ensure => $ntp::service_ensure,
1111
enable => $ntp::service_enable,
1212
name => $ntp::service_name,
13+
provider => $ntp::service_provider,
1314
hasstatus => true,
1415
hasrestart => true,
1516
}

0 commit comments

Comments
 (0)