Puppet Class: system::ntp

Defined in:
manifests/ntp.pp

Overview

Parameters:

  • config (Any) (defaults to: undef)
  • schedule (Any) (defaults to: $::system::schedule)


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
# File 'manifests/ntp.pp', line 1

class system::ntp (
  $config   = undef,
  $schedule = $::system::schedule,
) {
  if $config {
    if $config['servers'] {
      class { '::ntp':
        servers => $config['servers'],
        iburst  => $config['iburst'],
      }
    }
    elsif $config['country'] {
      class { '::ntp':
        country => $config['country'],
        iburst  => $config['iburst'],
      }
    }
    elsif $config['continent'] {
      class { '::ntp':
        continent => $config['continent'],
        iburst    => $config['iburst'],
      }
    }
    else {
      class { '::ntp': }
    }
  }
  else {
    $servers   = hiera('system::ntp::servers',   undef)
    $country   = hiera('system::ntp::country',   undef)
    $continent = hiera('system::ntp::continent', undef)
    $iburst    = hiera('system::ntp::iburst',    true)
    if $servers {
      class { '::ntp':
        servers => $servers,
        iburst  => $iburst,
      }
    }
    elsif $country {
      class { '::ntp':
        country => $country,
        iburst  => $iburst,
      }
    }
    elsif $continent {
      class { '::ntp':
        continent => $continent,
        iburst  => $iburst,
      }
    }
    else {
      class { '::ntp': }
    }
  }
}