diff --git a/README.md b/README.md index 188d2c3..af84c47 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,14 @@ INSTALLATION CONFIGURATION * manage NRPE service user properties -* manage directory structure (file system permissions, selinux context) -* +* manage directory structure (file system permissions, selinux context) through parameters +* manage configuration files through parameters: + * nrpe.conf + * nrpe.cfg +* manage iptables (optionals ) SERVICE +* manage NRPE service ### Repo Structure Repostructure has moved to REPOSTRUCTURE.md in repo. @@ -46,6 +50,7 @@ Repostructure has moved to REPOSTRUCTURE.md in repo. All dependencies must be included in the catalogue. * [cd_resources](https://gitlab.puppetsoft.com/12WW1160/cd_resources) to manage YUM repositories. +* [cd_firewall](https://gitlab.puppetsoft.com/12WW1160/cd_firewall) or [puppetlabs firewall](https://github.com/puppetlabs/puppetlabs-firewall) to manage iptables * [cd_stdlib](https://gitlab.puppetsoft.com/12WW1160/cd_stdlib) or [puppetlabs stdlib](https://github.com/puppetlabs/puppetlabs-stdlib) to facilitate concat * [cd_concat](https://gitlab.puppetsoft.com/12WW1160/cd_stdlib) or [puppetlabs concat](https://github.com/puppetlabs/puppetlabs-concat) for concatenating files diff --git a/manifests/main/files.pp b/manifests/main/files.pp index ed994e2..2358aed 100644 --- a/manifests/main/files.pp +++ b/manifests/main/files.pp @@ -26,6 +26,8 @@ class cd_nrpe::main::files ( require cd_nrpe::main::dirs + # manage /etc/nagios/nrpe.cfg + file { $ne_main_conf_file: ensure => file, path => $ne_main_conf_file, @@ -36,6 +38,22 @@ class cd_nrpe::main::files ( selrole => object_r, seltype => nrpe_etc_t, seluser => system_u, + content => template($ne_main_conf_erb), + notify => Service[$ne_service], + } + + # manage /etc/sysconfig/nrpe + + file { $ne_nrpe_conf_file: + ensure => file, + path => $ne_nrpe_conf_file, + owner => 'root', + group => 'root', + mode => '0640', + selrange => s0, + selrole => object_r, + seltype => etc_t, + seluser => system_u, content => template($ne_nrpe_conf_erb), notify => Service[$ne_service], } diff --git a/manifests/main/service.pp b/manifests/main/service.pp index dcfcc70..cb6300c 100644 --- a/manifests/main/service.pp +++ b/manifests/main/service.pp @@ -28,7 +28,7 @@ class cd_nrpe::main::service ( require cd_nrpe::firewall::iptables } - require cd_nrpe::main::files + require cd_nrpe::main::install service { $ne_service: ensure => running, diff --git a/manifests/params.pp b/manifests/params.pp index b7d4858..b42c257 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -122,7 +122,7 @@ $ne_ssl_cert_file = "/etc/pki/tls/certs/${::fqdn}.crt.pem", $ne_ssl_privatekey_file = "/etc/pki/tls/private/${::fqdn}.key.pem", $ne_ssl_client_certs = '2', $ne_ssl_logging = '0x00', -$ne_nasty_metachars = '\"|`&><\'\\[]{};\r\n\"', +$ne_nasty_metachars = '"|`&><\'\\[]{};\r\n\"', $ne_include_file = '', # nrpe.conf @@ -152,8 +152,10 @@ $ne_run_dir = '/var/run/nrpe' # files $ne_main_conf_file = '/etc/nagios/nrpe.cfg' -$ne_nrpe_conf_erb = 'cd_nrpe/nrpe_cfg.erb' +$ne_main_conf_erb = 'cd_nrpe/nrpe_cfg.erb' $ne_nrpe_pid_file = "${ne_run_dir}/nrpe.pid" +$ne_nrpe_conf_file = '/etc/sysconfig/nrpe' +$ne_nrpe_conf_erb = 'cd_nrpe/nrpe_conf.erb' # includes must be last