Puppet Class: psick::time

Defined in:
manifests/time.pp

Overview

Class psick::time This class manages time on different OS in various ways:

On Windows the psick::windows::time class is used to set ntp.

Parameters:

  • servers (Array) (defaults to: [])

    Arrays of ntp servers to set

  • method (Enum['chrony','ntpdate','ntp','']) (defaults to: 'ntpdate')

    How to set time via ntp. chrony - use Chrony. Requires aboe/chrony module ntp - use official Puppet Ntp module. Requires puppetlabs/ntp ntpdate - Schedule ntp updates via psick::time::ntpdate

  • timezone (Optional[String]) (defaults to: $psick::timezone)
  • manage (Boolean) (defaults to: $psick::manage)
  • noop_manage (Boolean) (defaults to: $psick::noop_manage)
  • noop_value (Boolean) (defaults to: $psick::noop_value)


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

class psick::time (
  Array $servers                            = [],
  Optional[String] $timezone                = $psick::timezone,
  Enum['chrony','ntpdate','ntp',''] $method = 'ntpdate',

  Boolean             $manage               = $psick::manage,
  Boolean             $noop_manage          = $psick::noop_manage,
  Boolean             $noop_value           = $psick::noop_value,
) {
  if $manage {
    if $noop_manage {
      noop($noop_value)
    }

    if $facts['kernel'] != 'windows' and $timezone {
      contain psick::timezone
    }

    if $facts['kernel'] == 'Linux' and $method == 'chrony' {
      class { 'chrony':
        servers => $servers,
      }
    }

    if $facts['kernel'] == 'Linux' and $method == 'ntpdate' {
      contain psick::time::ntpdate
    }

    if $facts['kernel'] != 'Windows' and $method == 'ntp' {
      class { 'ntp':
        servers => $servers,
      }
    }

    if $facts['os']['family'] == 'Windows' {
      contain psick::time::windows
    }
  }
}