Compare commits
8 Commits
d2dbb1c5fb
...
1.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| dc86fb5ce8 | |||
| 6138fdfcaa | |||
| 3e9e52b144 | |||
| 097956676e | |||
| 16597c16d5 | |||
| ceabad8b19 | |||
| 211341c62c | |||
| f49683ea7f |
@@ -8,7 +8,7 @@ class confdroid_ntp::main::config (
|
|||||||
) inherits confdroid_ntp::params {
|
) inherits confdroid_ntp::params {
|
||||||
include confdroid_ntp::main::service
|
include confdroid_ntp::main::service
|
||||||
|
|
||||||
# if $ay_manage_nagios == true {
|
if $cy_manage_nagios == true {
|
||||||
# include confdroid_ntp::monitoring::target
|
include confdroid_ntp::monitoring::target
|
||||||
# }
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,9 +47,9 @@ class confdroid_ntp::main::dirs (
|
|||||||
# /run/chrony-dhcp
|
# /run/chrony-dhcp
|
||||||
file { '/run/chrony-dhcp':
|
file { '/run/chrony-dhcp':
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
owner => 'chrony',
|
owner => 'root',
|
||||||
group => 'chrony',
|
group => 'root',
|
||||||
mode => '0750',
|
mode => '0755',
|
||||||
selrange => s0,
|
selrange => s0,
|
||||||
selrole => object_r,
|
selrole => object_r,
|
||||||
seltype => chronyd_var_run_t,
|
seltype => chronyd_var_run_t,
|
||||||
|
|||||||
@@ -23,6 +23,27 @@ class confdroid_ntp::main::files (
|
|||||||
}
|
}
|
||||||
|
|
||||||
# drift file /var/lib/chrony/drift
|
# drift file /var/lib/chrony/drift
|
||||||
|
file { $cy_drift_file:
|
||||||
|
ensure => file,
|
||||||
|
owner => 'chrony',
|
||||||
|
group => 'chrony',
|
||||||
|
mode => '0644',
|
||||||
|
selrange => s0,
|
||||||
|
selrole => object_r,
|
||||||
|
seltype => chronyd_var_lib_t,
|
||||||
|
seluser => system_u,
|
||||||
|
}
|
||||||
|
|
||||||
# log rotation
|
# log rotation
|
||||||
|
file { $cy_logrotate_file:
|
||||||
|
ensure => file,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
mode => '0644',
|
||||||
|
selrange => s0,
|
||||||
|
selrole => object_r,
|
||||||
|
seltype => etc_t,
|
||||||
|
seluser => system_u,
|
||||||
|
content => template($cy_logrotate_erb),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,4 +6,18 @@
|
|||||||
class confdroid_ntp::monitoring::target (
|
class confdroid_ntp::monitoring::target (
|
||||||
|
|
||||||
) inherits confdroid_ntp::params {
|
) inherits confdroid_ntp::params {
|
||||||
|
if $cy_manage_nagios == true {
|
||||||
|
@@nagios_service { "check_chronyd_${fqdn}":
|
||||||
|
check_command => "check_nrpe!check_chronyd!${cy_procs_allowed}!chronyd",
|
||||||
|
use => 'generic-service',
|
||||||
|
host_name => $fqdn,
|
||||||
|
notification_period => '24x7',
|
||||||
|
service_description => "${fqdn}_check_chronyd",
|
||||||
|
target => $cy_target_service,
|
||||||
|
owner => 'nagios',
|
||||||
|
group => 'nagios',
|
||||||
|
mode => '0640',
|
||||||
|
contacts => $cy_target_contacts,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,11 @@
|
|||||||
# @param [String] cy_loginfo Log information to record. Valid values are
|
# @param [String] cy_loginfo Log information to record. Valid values are
|
||||||
# 'measurements', 'statistics', and 'tracking'.
|
# 'measurements', 'statistics', and 'tracking'.
|
||||||
# @param [Boolean] cy_use_lan_server Whether to use a local LAN server or external pool.
|
# @param [Boolean] cy_use_lan_server Whether to use a local LAN server or external pool.
|
||||||
|
# @param [Boolean] cy_manage_nagios Whether to manage Nagios monitoring for the module.
|
||||||
|
# @param [String] cy_procs_allowed Number of allowed processes for the Nagios check.
|
||||||
|
# @param [String] cy_target_service Path to the Nagios service configuration file.
|
||||||
|
# @param [Array] cy_target_contacts List of Nagios contacts for notifications.
|
||||||
|
# must exist in Nagios contacts configuration!
|
||||||
###############################################################################
|
###############################################################################
|
||||||
class confdroid_ntp::params (
|
class confdroid_ntp::params (
|
||||||
|
|
||||||
@@ -35,6 +40,12 @@ class confdroid_ntp::params (
|
|||||||
String $cy_leapsectz = 'right/UTC',
|
String $cy_leapsectz = 'right/UTC',
|
||||||
String $cy_loginfo = 'measurements statistics tracking',
|
String $cy_loginfo = 'measurements statistics tracking',
|
||||||
|
|
||||||
|
# monitoring
|
||||||
|
Boolean $cy_manage_nagios = false,
|
||||||
|
String $cy_procs_allowed = '1:',
|
||||||
|
String $cy_target_service = '/etc/nagios/conf.d/chronyd_service.cfg',
|
||||||
|
Array $cy_target_contacts = ['nagiosadmin'],
|
||||||
|
|
||||||
) {
|
) {
|
||||||
# facts
|
# facts
|
||||||
$fqdn = $facts['networking']['fqdn']
|
$fqdn = $facts['networking']['fqdn']
|
||||||
@@ -47,6 +58,9 @@ class confdroid_ntp::params (
|
|||||||
# files
|
# files
|
||||||
$cy_conf_file = '/etc/chrony.conf'
|
$cy_conf_file = '/etc/chrony.conf'
|
||||||
$cy_conf_erb = 'confdroid_ntp/chrony.conf.erb'
|
$cy_conf_erb = 'confdroid_ntp/chrony.conf.erb'
|
||||||
|
$cy_drift_file = '/var/lib/chrony/drift'
|
||||||
|
$cy_logrotate_file = '/etc/logrotate.d/chrony'
|
||||||
|
$cy_logrotate_erb = 'confdroid_ntp/logrotate.chrony.erb'
|
||||||
|
|
||||||
# service
|
# service
|
||||||
$cy_service = 'chronyd'
|
$cy_service = 'chronyd'
|
||||||
|
|||||||
9
templates/logrotate.chrony.erb
Normal file
9
templates/logrotate.chrony.erb
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# file created by Puppet, manual changes will be overwritten
|
||||||
|
/var/log/chrony/*.log {
|
||||||
|
missingok
|
||||||
|
nocreate
|
||||||
|
sharedscripts
|
||||||
|
postrotate
|
||||||
|
/usr/bin/chronyc cyclelogs > /dev/null 2>&1 || true
|
||||||
|
endscript
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user