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
+30
View File
@@ -0,0 +1,30 @@
# setup an ntp client using chrony
# use exported resources from profiles::ntp::server if they are available
class profiles::ntp::client (
Array $peers,
Boolean $wait_enable = true,
Enum[
'running',
'stopped'
] $wait_ensure = 'running',
Boolean $client_only = true,
) {
# If $client_only, setup a client. Servers are set to false so that they are configured
# through the profiles::ntp::server class.
if $client_only {
# Define the client configuration based on OS family
if $facts['os']['family'] == 'RedHat' {
class { 'chrony':
servers => $peers,
wait_enable => $wait_enable,
wait_ensure => $wait_ensure,
}
} else {
class { 'chrony':
servers => $peers,
}
}
}
}