Puppet Class: lsys::ntpdate
- Defined in:
- manifests/ntpdate.pp
Summary
ntpdate supportOverview
ntpdate support
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'manifests/ntpdate.pp', line 7
class lsys::ntpdate (
String $package_ensure = 'latest',
Integer $retries = 2,
Boolean $sync_hwclock = false,
Boolean $enable_hardening = false,
) {
$os_release_major = $facts['os']['release']['major']
if ($facts['os']['family'] == 'RedHat' and $os_release_major == '7')
or $facts['os']['name'] == 'Ubuntu' {
package { 'ntpdate':
ensure => $package_ensure,
}
if $enable_hardening {
file { '/usr/sbin/ntpdate': mode => 'o=' }
}
if $facts['os']['family'] == 'RedHat' {
# -s Divert logging output from the standard output (default) to the
# system syslog facility. This is designed primarily for convenience
# of cron scripts.
# -b Force the time to be stepped using the settimeofday() system call,
# rather than slewed (default) using the adjtime() system call. This
# option should be used when called from a startup file at boot time.
# -p samples
# Specify the number of samples to be acquired from each server as the
# integer samples, with values from 1 to 8 inclusive. The default is 4.
$options = $os_release_major ? {
'6' => '-U ntp -s -b',
'7' => '-p 2',
}
file { '/etc/sysconfig/ntpdate':
content => template('lsys/ntpdate/sysconfig.erb'),
owner => 'root',
group => 'root',
mode => '0644',
require => Package['ntpdate'],
}
service { 'ntpdate':
enable => true,
require => File['/etc/sysconfig/ntpdate'],
}
}
}
}
|