Puppet Class: chrony::params

Inherited by:
chrony
Defined in:
manifests/params.pp

Overview



1
2
3
4
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'manifests/params.pp', line 1

class chrony::params {

  $bindcmdaddress   = [ '127.0.0.1', '::1' ]
  $client_allow     = []
  $client_deny      = []
  $client_log       = false
  $config_template  = 'chrony/chronyd.conf.erb'
  $offline          = false
  $package_ensure   = 'present'
  $refclock         = []
  $rtconutc         = true
  $serve_ntp        = false
  $service_enable   = true
  $service_ensure   = 'running'
  $service_manage   = true
  $source_port      = undef
  $sync_local_clock = true
  $udlc             = false

  case $::osfamily {
    'Archlinux': {
      $config = '/etc/chrony.conf'
      $driftfile = '/var/lib/chrony/drift'
      $keys_file = '/etc/chrony.keys'
      $log_dir = '/var/log/chrony'
      $package_name = 'chrony'
      $servers = [
        '0.pool.ntp.org iburst',
        '1.pool.ntp.org iburst',
        '2.pool.ntp.org iburst',
        '3.pool.ntp.org iburst',
      ]
      $service_hasstatus = true
      $service_name = 'chrony'
      $stratumweight = 0
    }
    'Debian': {
      $config = '/etc/chrony/chrony.conf'
      $driftfile = '/var/lib/chrony/chrony.drift'
      $keys_file = '/etc/chrony/chrony.keys'
      $log_dir = '/var/log/chrony'
      $package_name = 'chrony'
      if
        ($::operatingsystem == 'Ubuntu' and $::operatingsystemrelease < '12.04')
        or
        ($::operatingsystem == 'Debian' and $::operatingsystemrelease < '7')
          {
            # These old versions don't support stratumweight or iburst
            $stratumweight = undef
            $servers = [
              '0.debian.pool.ntp.org',
              '1.debian.pool.ntp.org',
              '2.debian.pool.ntp.org',
              '3.debian.pool.ntp.org',
            ]
          }
      else {
        $stratumweight = 0
        $servers = [
          '0.debian.pool.ntp.org iburst',
          '1.debian.pool.ntp.org iburst',
          '2.debian.pool.ntp.org iburst',
          '3.debian.pool.ntp.org iburst',
        ]
      }
      $service_hasstatus = false
      $service_name = 'chrony'
    }
    'RedHat': {
      $config = '/etc/chrony.conf'
      $driftfile = '/var/lib/chrony/drift'
      $keys_file = '/etc/chrony.keys'
      $log_dir = '/var/log/chrony'
      $package_name = 'chrony'
      $servers = [
        '0.centos.pool.ntp.org iburst',
        '1.centos.pool.ntp.org iburst',
        '2.centos.pool.ntp.org iburst',
        '3.centos.pool.ntp.org iburst',
      ]
      $service_hasstatus = true
      $service_name = 'chronyd'
      $stratumweight = 0
    }
    default: {
      fail("The ${module_name} module is not supported on an ${::operatingsystem} distribution.")
    }
  }
}