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
This commit is contained in:
2023-11-10 23:21:08 +11:00
parent 11508f2538
commit 9cb730d116
8 changed files with 105 additions and 12 deletions
+34
View File
@@ -0,0 +1,34 @@
# 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,
}
}
}