OP#830 add server vs pool control
This commit is contained in:
@@ -5,7 +5,11 @@
|
|||||||
# @param [Array] cy_reqpackages List of required packages to install
|
# @param [Array] cy_reqpackages List of required packages to install
|
||||||
# for the confdroid_ntp module.
|
# for the confdroid_ntp module.
|
||||||
# @param [String] cy_pkg_ensure Ensure state of the required packages.
|
# @param [String] cy_pkg_ensure Ensure state of the required packages.
|
||||||
##############################################################################
|
# @param [String] cy_server_fqdn FQDN of the NTP server to configure.
|
||||||
|
# If the fqdn of the host matches this value, a time server will be
|
||||||
|
# configured, else a client.
|
||||||
|
# @param [Array] cy_conf_servers List of NTP servers to point to as time source
|
||||||
|
###############################################################################
|
||||||
class confdroid_ntp::params (
|
class confdroid_ntp::params (
|
||||||
|
|
||||||
# installation
|
# installation
|
||||||
@@ -13,6 +17,7 @@ class confdroid_ntp::params (
|
|||||||
String $cy_pkg_ensure = 'present',
|
String $cy_pkg_ensure = 'present',
|
||||||
|
|
||||||
# configuration
|
# configuration
|
||||||
|
String $cy_server_fqdn = 'ntp.example.com',
|
||||||
Array $cy_conf_servers = ['0.pool.ntp.org', '1.pool.ntp.org', '2.pool.ntp.org', '3.pool.ntp.org'],
|
Array $cy_conf_servers = ['0.pool.ntp.org', '1.pool.ntp.org', '2.pool.ntp.org', '3.pool.ntp.org'],
|
||||||
|
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -1,3 +1,17 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
### chrony.conf created by Puppet, manual changes will be overwritten ###
|
### chrony.conf created by Puppet, manual changes will be overwritten ###
|
||||||
################################################################################
|
################################################################################
|
||||||
|
### original chrony.conf file can be found at https://3for.me/2t0an ###
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
<% if @cy_server_fqdn == $fqdn -%>
|
||||||
|
# This is a time server configuration file
|
||||||
|
<% @cy_conf_servers.each do |this_server| -%>
|
||||||
|
pool <%= this_server %> iburst
|
||||||
|
<% end -%>
|
||||||
|
<% else -%>
|
||||||
|
# This is a time client configuration file
|
||||||
|
<% @cy_server_fqdn.each do |this_server| -%>
|
||||||
|
server <%= this_server %> iburst
|
||||||
|
<% end end -%>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user