OP#436 add user access
This commit is contained in:
31
manifests/server/access.pp
Normal file
31
manifests/server/access.pp
Normal file
@@ -0,0 +1,31 @@
|
||||
## confdroid_nagios::server::access.pp
|
||||
# Module name: confdroid_nagios
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class manages access configuration for the confdroid_nagios module.
|
||||
# @param [String] ng_htpasswd_user The username for the Nagios web interface.
|
||||
# @param [String] ng_htpasswd_password The encrypted password for the Nagios web interface.
|
||||
# @example
|
||||
# confdroid_nagios::server::access { 'example':
|
||||
# ng_htpasswd_user => 'example_user',
|
||||
# ng_htpasswd_password => 'example_password_encrypted',
|
||||
# }
|
||||
###############################################################################
|
||||
define confdroid_nagios::server::access (
|
||||
Optional[String] $ng_htpasswd_user = undef,
|
||||
Optional[String] $ng_htpasswd_password = undef,
|
||||
) {
|
||||
$ng_nagios_server = $confdroid_nagios::params::ng_nagios_server
|
||||
$ng_htpasswd_file = $confdroid_nagios::params::ng_htpasswd_file
|
||||
$ng_htpasswd_rule = $confdroid_nagios::params::ng_htpasswd_rule
|
||||
$ng_service = $confdroid_nagios::params::ng_nagios_service
|
||||
|
||||
if $fqdn == $ng_nagios_server {
|
||||
# create password rules
|
||||
|
||||
concat::fragment { $name:
|
||||
target => $ng_htpasswd_file,
|
||||
content => template($ng_htpasswd_rule),
|
||||
}
|
||||
}
|
||||
}
|
||||
v
|
||||
Reference in New Issue
Block a user