Puppet Class: ntpd::ntpdate

Defined in:
manifests/ntpdate.pp

Summary

Manage the setup of ``ntpdate``

Overview



5
6
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
# File 'manifests/ntpdate.pp', line 5

class ntpd::ntpdate {
  assert_private()

  simplib::module_metadata::assert($module_name)

  $bool_to_yes_no = {
    true  => 'yes',
    false => 'no'
  }

  $ntpdate_vars = {
    'sync_hwclock' => $bool_to_yes_no[$::ntpd::ntpdate_sync_hwclock],
    'retry'        => $ntpd::ntpdate_retry,
    'options'      => $ntpd::ntpdate_options,
  }
  file { '/etc/sysconfig/ntpdate':
    ensure  => 'file',
    owner   => 'root',
    group   => 'root',
    mode    => '0640',
    content => epp("${module_name}/ntpdate.epp", $ntpdate_vars)
  }

  $servers = $::ntpd::ntpdate_servers
  if $servers =~ Array {
    $_servers = $servers
  }
  else {
    $_servers = $servers.keys
  }
  file { '/etc/ntp/step-tickers':
    ensure  => 'file',
    content => epp("${module_name}/step-tickers.epp", { 'ntp_servers' => $_servers }),
    notify  => Service['ntpd']
  }
}