2026-02-14 21:05:02 +01:00
|
|
|
## confdroid_nagios::server::access_rules.pp
|
|
|
|
|
# Module name: confdroid_nagios
|
|
|
|
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
|
|
|
|
# @summary Class manages presence of /etc/nagios/passwd file.
|
|
|
|
|
#############################################################################
|
|
|
|
|
class confdroid_nagios::server::access_rules (
|
|
|
|
|
|
|
|
|
|
) inherits confdroid_nagios::params {
|
|
|
|
|
if $fqdn == $ng_nagios_server {
|
|
|
|
|
# manage /etc/nagios/passwd file
|
|
|
|
|
|
|
|
|
|
concat { $ng_htpasswd_file:
|
|
|
|
|
ensure => present,
|
|
|
|
|
path => $ng_htpasswd_file,
|
|
|
|
|
owner => 'root',
|
|
|
|
|
group => 'apache',
|
|
|
|
|
mode => '0640',
|
|
|
|
|
selrange => s0,
|
|
|
|
|
selrole => object_r,
|
|
|
|
|
seltype => nagios_etc_t,
|
|
|
|
|
seluser => system_u,
|
2026-03-01 14:21:30 +01:00
|
|
|
notify => Exec['ng_restart_httpd'],
|
2026-02-14 21:05:02 +01:00
|
|
|
}
|
2026-02-14 21:21:43 +01:00
|
|
|
|
|
|
|
|
# manage file header
|
|
|
|
|
concat::fragment { 'fle_header':
|
|
|
|
|
target => $ng_htpasswd_file,
|
|
|
|
|
content => template($ng_htpasswd_head),
|
|
|
|
|
order => '000',
|
|
|
|
|
}
|
2026-02-14 21:28:05 +01:00
|
|
|
}
|
2026-02-14 21:05:02 +01:00
|
|
|
}
|