Puppet Class: ntp::params

Inherited by:
ntp
ntp::ntpdate
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
# File 'manifests/params.pp', line 1

class ntp::params {
  # Common

  case $::osfamily {
    'Debian': {
      $package = 'ntp'
      $config_file = '/etc/ntp.conf'
      $service_name = 'ntp'
      $driftfile = '/var/lib/ntp/ntp.drift'
      $defaults_file = '/etc/default/ntp'
      $defaults_file_tpl = 'ntp.defaults.debian.erb'
      $ntpd_start_options = '-g'
    }
    'RedHat': {
      $package = 'ntp'
      $config_file = '/etc/ntp.conf'
      $service_name = 'ntpd'
      $driftfile = '/var/lib/ntp/drift'
      $defaults_file = '/etc/sysconfig/ntpd'
      $defaults_file_tpl = 'ntp.defaults.redhat.erb'
      case $::operatingsystem {
        'RedHat', 'CentOS', 'Scientific', 'SLC', 'OracleLinux', 'OVS', 'OEL': {
          $ntpd_start_options = '-u ntp:ntp -p /var/run/ntpd.pid -g'
          if versioncmp($::operatingsystemmajrelease, '6') >= 0 {
            $ntpdate_package = 'ntpdate'
            $ntpdate_config_file = '/etc/ntp/step-tickers'
            $ntpdate_defaults_file = '/etc/sysconfig/ntpdate'
            $ntpdate_service_name = 'ntpdate'
            $ntpdate_options = '-U ntp -s -b'
          }
        }
        'Fedora': {
          $ntpdate_package = 'ntpdate'
          $ntpdate_config_file = '/etc/ntp/step-tickers'
          $ntpdate_defaults_file = '/etc/sysconfig/ntpdate'
          $ntpdate_service_name = 'ntpdate'
          $ntpdate_options = '-U ntp -s -b'
          $ntpd_start_options = '-p /var/run/ntpd.pid -g'
        }
        default: {
          fail("Unsupported platform: ${::osfamily}/${::operatingsystem}")
        }
      }
    }
    'Suse': {
      $package = 'ntp'
      $config_file = '/etc/ntp.conf'
      if versioncmp($::operatingsystemrelease, '13.2') == 0 {
        $service_name = 'ntpd'
      } elsif $::operatingsystem == 'SLES' and versioncmp($::operatingsystemmajrelease, '12') >= 0 {
        $service_name = 'ntpd'
      } else {
        $service_name = 'ntp'
      }
      $driftfile = '/var/lib/ntp/drift/ntp.drift'
    }
    'Gentoo': {
      $package = 'net-misc/ntp'
      $config_file = '/etc/ntp.conf'
      $service_name = 'ntpd'
      $driftfile = '/var/lib/ntp/ntp.drift'
      $defaults_file = '/etc/conf.d/ntpd'
      $defaults_file_tpl = 'ntp.defaults.debian.erb'
      $ntpd_start_options = '-g'
    }
    'Archlinux': {
      $package = 'ntp'
      $config_file = '/etc/ntp.conf'
      $service_name = 'ntpd'
      $driftfile = '/var/lib/ntp/ntp.drift'
    }
    default: {
      fail("Unsupported platform: ${::osfamily}")
    }
  }
}