forked from voxpupuli/puppet-nrpe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request voxpupuli#8 from alexjfisher/install_config_service
Major refactor into install/config/service pattern
- Loading branch information
Showing
15 changed files
with
401 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# @api private | ||
class nrpe::config | ||
{ | ||
unless $nrpe::supplementary_groups.empty { | ||
user { $nrpe::nrpe_user: | ||
gid => $nrpe::nrpe_group, | ||
groups => $nrpe::supplementary_groups, | ||
} | ||
} | ||
|
||
concat { $nrpe::config: | ||
ensure => present, | ||
} | ||
|
||
$_allow_bash_command_substitution = $nrpe::allow_bash_command_substitution ? { | ||
undef => undef, | ||
default => bool2str($nrpe::allow_bash_command_substitution, '1', '0'), | ||
} | ||
|
||
concat::fragment { 'nrpe main config': | ||
target => $nrpe::config, | ||
content => epp( | ||
'nrpe/nrpe.cfg.epp', | ||
{ | ||
'log_facility' => $nrpe::log_facility, | ||
'nrpe_pid_file' => $nrpe::nrpe_pid_file, | ||
'server_port' => $nrpe::server_port, | ||
'server_address' => $nrpe::server_address, | ||
'nrpe_user' => $nrpe::nrpe_user, | ||
'nrpe_group' => $nrpe::nrpe_group, | ||
'allowed_hosts' => $nrpe::allowed_hosts, | ||
'dont_blame_nrpe' => bool2str($nrpe::dont_blame_nrpe, '1', '0'), | ||
'allow_bash_command_substitution' => $_allow_bash_command_substitution, | ||
'libdir' => $nrpe::params::libdir, | ||
'command_prefix' => $nrpe::command_prefix, | ||
'debug' => bool2str($nrpe::debug, '1', '0'), | ||
'command_timeout' => $nrpe::command_timeout, | ||
'connection_timeout' => $nrpe::connection_timeout, | ||
} | ||
), | ||
order => '01', | ||
} | ||
|
||
if $nrpe::ssl_cert_file_content { | ||
contain nrpe::config::ssl | ||
} | ||
|
||
concat::fragment { 'nrpe includedir': | ||
target => $nrpe::config, | ||
content => "include_dir=${nrpe::include_dir}\n", | ||
order => '99', | ||
} | ||
|
||
file { 'nrpe_include_dir': | ||
ensure => directory, | ||
name => $nrpe::include_dir, | ||
purge => $nrpe::purge, | ||
recurse => $nrpe::recurse, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# @api private | ||
class nrpe::config::ssl | ||
{ | ||
$_ssl_client_certs = $nrpe::ssl_client_certs ? { | ||
'ask' => '1', | ||
'require' => '2', | ||
default => '0', # $ssl_client_certs = 'no' | ||
} | ||
|
||
concat::fragment { 'nrpe ssl fragment': | ||
target => $nrpe::config, | ||
content => epp( | ||
'nrpe/nrpe.cfg-ssl.epp', | ||
{ | ||
'ssl_version' => $nrpe::ssl_version, | ||
'ssl_ciphers' => $nrpe::ssl_ciphers, | ||
'nrpe_ssl_dir' => $nrpe::nrpe_ssl_dir, | ||
'ssl_client_certs' => $_ssl_client_certs, | ||
'ssl_logging' => nrpe::ssl_logging( | ||
$nrpe::ssl_log_startup_params, | ||
$nrpe::ssl_log_remote_ip, | ||
$nrpe::ssl_log_protocol_version, | ||
$nrpe::ssl_log_cipher, | ||
$nrpe::ssl_log_client_cert, | ||
$nrpe::ssl_log_client_cert_details | ||
) | ||
} | ||
), | ||
order => '02', | ||
} | ||
|
||
file { $nrpe::nrpe_ssl_dir: | ||
ensure => directory, | ||
owner => 'root', | ||
group => $nrpe::nrpe_group, | ||
mode => '0750', | ||
} | ||
file { "${nrpe::nrpe_ssl_dir}/ca-cert.pem": | ||
ensure => file, | ||
owner => 'root', | ||
group => $nrpe::nrpe_group, | ||
mode => '0640', | ||
content => $nrpe::ssl_cacert_file_content, | ||
} | ||
file { "${nrpe::nrpe_ssl_dir}/nrpe-cert.pem": | ||
ensure => file, | ||
owner => 'root', | ||
group => $nrpe::nrpe_group, | ||
mode => '0640', | ||
content => $nrpe::ssl_cert_file_content, | ||
} | ||
file { "${nrpe::nrpe_ssl_dir}/nrpe-key.pem": | ||
ensure => file, | ||
owner => 'root', | ||
group => $nrpe::nrpe_group, | ||
mode => '0640', | ||
content => $nrpe::ssl_privatekey_file_content, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# @api private | ||
class nrpe::install | ||
{ | ||
if $nrpe::manage_package { | ||
package { $nrpe::package_name: | ||
ensure => installed, | ||
provider => $nrpe::provider, | ||
} | ||
} | ||
} |
Oops, something went wrong.