diff --git a/README.md b/README.md index ca941d3..7332790 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Readme - +[![Build Status](https://jenkins.confdroid.com/job/confdroid_nrpe/badge/icon?style=plastic)](https://jenkins.confdroid.com/job/confdroid_nrpe/) +[![Security Hotspots](https://sonarqube.confdroid.com/api/project_badges/measure?project=confdroid_nagios&metric=security_hotspots&token=sqb_927c2cd1f1b90805cde962af0f5eda9ec936eb6f)](https://sonarqube.confdroid.com/dashboard?id=confdroid_nagios) - [Readme](#readme) - [Synopsis](#synopsis) @@ -37,8 +38,6 @@ See the full Puppet documentation including parameters in `docs/index.html` All dependencies must be included in the catalogue. - - ## Deployment * native Puppet deployment @@ -81,8 +80,8 @@ All files and directories are configured with correct selinux context. If selinu ## Contact Us -[contact Us](https://confdroid.com/contact/) -[Feedback portal](https://feedback.confdroid.com/) +* [contact Us](https://confdroid.com/contact/) +* [Feedback Portal](https://feedback.confdroid.com/) ## Disclaimer diff --git a/manifests/main/install.pp b/manifests/main/install.pp index 004762a..5935454 100644 --- a/manifests/main/install.pp +++ b/manifests/main/install.pp @@ -1,12 +1,25 @@ ## confdroid_nagios::main::install.pp # Module name: confdroid_nagios # Author: 12ww1160 (12ww1160@confdroid.com) -# @summary Class manaages main configuration for the confdroid_nagios module. +# @summary Class manages main configuration for the confdroid_nagios module. ############################################################################### class confdroid_nagios::main::install ( ) inherits confdroid_nagios::params { if $ng_nagios_server == $fqdn { - #config here + require confdroid_resources + # if our FQDN matches the configured Nagios server FQDN, install both server- + # and client packages. + if $fqdn == $ng_nagios_server { + # we'll need httpd installed + require confdroid_apache + + package {$ng_reqpackages_server: + ensure => $ng_pkg_ensure, + } + package {$ng_reqpackages_client: + ensure => $ng_pkg_ensure, + } + } } } diff --git a/manifests/params.pp b/manifests/params.pp index a52d1de..9c853e3 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -6,11 +6,36 @@ # @param [String] ng_nagios_server The hostname or IP address of the # Nagios server. This will determine the installation selection and the # of the clients to connect to the Nagios server. +# @param [Array] ng_reqpackages_server An array of packages to be installed on +# the Nagios server. +# @param [Array] ng_reqpackages_client An array of packages to be installed on +# the Nagios clients. +# @param [String] ng_pkg_ensure The ensure value for all packages. Default is +# 'present'. ############################################################################### class confdroid_nagios::params ( # main - String $ng_nagios_server = 'nagios.example.net', + String $ng_nagios_server = 'nagios.example.net', + Array $ng_reqpackages_server = ['nagios','nagios-devel'], + Array $ng_reqpackages_client = ['net-snmp-utils','nagios-plugins','nagios-plugins-all','nagios-plugins-nrpe','nagios-common'], + String $ng_pkg_ensure = 'present', + +) { +# service + $ng_service = 'nagios' + $ae_service = 'httpd' + +# directories + $ng_main_dir = '/etc/nagios' + $ng_conf_d_dir = "${ng_main_dir}/conf.d" + $ng_objects_dir = "${ng_main_dir}/objects" + $ng_private_dir = "${ng_main_dir}/private" + $ng_usr_incl = '/usr/include/nagios' + $ng_lib_dir = '/usr/lib64/nagios' + $ng_log_dir = '/var/log/nagios' + $ng_log_archives = "${ng_log_dir}/archives" + $ng_spool_dir = '/var/spool/nagios' ) {