Puppet Class: almalinux_hardening::services::chrony

Defined in:
manifests/services/chrony.pp

Summary

- Install Install Chrony

Overview

Puppet Module to perform AlmaLinux 8 OS Hardening with CIS benchmark. Copyright © 2022 Jonas Hügli

Examples:

include almalinux_hardening::services::chrony


51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'manifests/services/chrony.pp', line 51

class almalinux_hardening::services::chrony {
  if $almalinux_hardening::enable_chrony_install {
    if $almalinux_hardening::enable_chrony_time_server {
      class { 'chrony':
        servers => $almalinux_hardening::time_servers,
      }
    }
    if $almalinux_hardening::enable_chrony_service {
      exec { 'reload_chrony':
        path        => '/usr/bin',
        command     => 'systemctl restart chronyd',
        refreshonly => true,
      }
      file_line { 'chronyd_options':
        ensure => 'present',
        path   => '/etc/sysconfig/chronyd',
        line   => 'OPTIONS="-u chrony"',
        match  => '^(#|).*OPTIONS.*=.*',
        notify => Exec['reload_chrony'],
      }
    }
  }
}