promote develop to master #6
@ -1,7 +1,10 @@
|
|||||||
---
|
---
|
||||||
|
profiles::ntp::client::ntp_role: 'roles::infra::ntp::server'
|
||||||
profiles::ntp::client::peers:
|
profiles::ntp::client::peers:
|
||||||
- ntp01.main.unkin.net
|
- 0.pool.ntp.org
|
||||||
- ntp02.main.unkin.net
|
- 1.pool.ntp.org
|
||||||
|
- 2.pool.ntp.org
|
||||||
|
- 3.pool.ntp.org
|
||||||
|
|
||||||
profiles::base::puppet_servers:
|
profiles::base::puppet_servers:
|
||||||
- 'prodinf01n01.main.unkin.net'
|
- 'prodinf01n01.main.unkin.net'
|
||||||
|
|||||||
@ -2,6 +2,10 @@
|
|||||||
# use exported resources from profiles::ntp::server if they are available
|
# use exported resources from profiles::ntp::server if they are available
|
||||||
class profiles::ntp::client (
|
class profiles::ntp::client (
|
||||||
Array $peers,
|
Array $peers,
|
||||||
|
Variant[
|
||||||
|
String,
|
||||||
|
Undef
|
||||||
|
] $ntp_role = undef,
|
||||||
Boolean $wait_enable = true,
|
Boolean $wait_enable = true,
|
||||||
Enum[
|
Enum[
|
||||||
'running',
|
'running',
|
||||||
@ -14,16 +18,23 @@ class profiles::ntp::client (
|
|||||||
# through the profiles::ntp::server class.
|
# through the profiles::ntp::server class.
|
||||||
if $client_only {
|
if $client_only {
|
||||||
|
|
||||||
|
# if ntp_role is set, find all hosts matching that enc_role
|
||||||
|
if $ntp_role == undef {
|
||||||
|
$ntpserver_array = $peers
|
||||||
|
}else{
|
||||||
|
$ntpserver_array = query_nodes("enc_role='${ntp_role}'", 'networking.fqdn')
|
||||||
|
}
|
||||||
|
|
||||||
# Define the client configuration based on OS family
|
# Define the client configuration based on OS family
|
||||||
if $facts['os']['family'] == 'RedHat' {
|
if $facts['os']['family'] == 'RedHat' {
|
||||||
class { 'chrony':
|
class { 'chrony':
|
||||||
servers => $peers,
|
servers => $ntpserver_array,
|
||||||
wait_enable => $wait_enable,
|
wait_enable => $wait_enable,
|
||||||
wait_ensure => $wait_ensure,
|
wait_ensure => $wait_ensure,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
class { 'chrony':
|
class { 'chrony':
|
||||||
servers => $peers,
|
servers => $ntpserver_array,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,7 +19,7 @@ class profiles::ntp::server (
|
|||||||
|
|
||||||
# check the enc_role has been set, it can take two puppet runs to do this
|
# check the enc_role has been set, it can take two puppet runs to do this
|
||||||
# TODO: change away from external fact
|
# TODO: change away from external fact
|
||||||
if $facts['enc_role'] == 'roles::infra::ntpserver' {
|
if $facts['enc_role'] == 'roles::infra::ntp::server' {
|
||||||
|
|
||||||
# define the server
|
# define the server
|
||||||
if $facts['os']['family'] == 'RedHat' {
|
if $facts['os']['family'] == 'RedHat' {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
# a role to deploy a ntp server
|
# a role to deploy a ntp server
|
||||||
class roles::infra::ntpserver {
|
class roles::infra::ntp::server {
|
||||||
include profiles::defaults
|
include profiles::defaults
|
||||||
include profiles::base
|
include profiles::base
|
||||||
include profiles::ntp::server
|
include profiles::ntp::server
|
||||||
Loading…
Reference in New Issue
Block a user