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:
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user