Puppet Class: archlinux_workstation::chrony

Defined in:
manifests/chrony.pp

Overview

Install and configure Chrony, a roaming/laptop friendly NTP client, as well as the networkmanager-dispatcher-chrony script for it.

Parameters:

  • chrony_password (String) (defaults to: 'd83ja72.f83,8wHUW94')

    The password that other clients will use to connect to chrony. Our configuration only has chrony listening on localhost/127.0.0.1, so this shouldn't be important.



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/chrony.pp', line 11

class archlinux_workstation::chrony (
  String $chrony_password = 'd83ja72.f83,8wHUW94',
) {

  if ! defined(Class['archlinux_workstation']) {
    fail('You must include the base archlinux_workstation class before using any subclasses')
  }

  package {'chrony':
    ensure => present,
  }

  # nm hooks to tell chrony when we're on/offline
  # this is an AUR package, which is in my repo
  package {'networkmanager-dispatcher-chrony':
    ensure  => present,
    require => Class['archlinux_workstation::repos::jantman'],
  }

  file {'/etc/chrony.conf':
    ensure  => present,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    source  => 'puppet:///modules/archlinux_workstation/chrony.conf',
    require => Package['chrony'],
    notify  => Service['chronyd'],
  }

  file {'/etc/chrony.keys':
    ensure  => present,
    owner   => 'root',
    group   => 'root',
    mode    => '0640',
    content => "1 ${chrony_password}",
    require => Package['chrony'],
    notify  => Service['chronyd'],
  }

  service {'chronyd':
    ensure => running,
    enable => true,
  }

}