- add ntp client and server class - add ntp server role - update hiera.yaml to work with enc_role - cleanup base profile
31 lines
786 B
Puppet
31 lines
786 B
Puppet
# 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,
|
|
}
|
|
}
|
|
}
|
|
}
|