puppet-prod/site/profiles/manifests/ntp/server.pp
Ben Vincent 9cb730d116 feat: add ntp server/client
- add ntp client and server class
- add ntp server role
- update hiera.yaml to work with enc_role
- cleanup base profile
2023-11-10 23:59:10 +11:00

35 lines
796 B
Puppet

# chronyd server class with exported resources
class profiles::ntp::server (
Array[Variant[
Stdlib::IP::Address::V4,
Stdlib::IP::Address::V4::CIDR
]] $allowquery = ['127.0.0.1'],
Array[Stdlib::Host] $peers = [
'0.pool.ntp.org',
'1.pool.ntp.org',
'2.pool.ntp.org',
'3.pool.ntp.org'
],
Boolean $wait_enable = true,
Enum[
'running',
'stopped'
] $wait_ensure = 'running',
){
# define the server
if $facts['os']['family'] == 'RedHat' {
class { 'chrony':
servers => $peers,
queryhosts => $allowquery,
wait_enable => $wait_enable,
wait_ensure => $wait_ensure,
}
} else {
class { 'chrony':
servers => $peers,
queryhosts => $allowquery,
}
}
}