123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404 |
- # == Class: icinga2::params
- #
- # This class contains config options and settings for use elsewhere in the module.
- #
- # === Parameters
- #
- # See the inline comments.
- #
- class icinga2::params {
- ##############################
- # Icinga 2 common parameters
- ##############################
- #This section has parameters that are used by both the client and server subclasses
- ##################
- # Icinga 2 common package parameters
- case $::operatingsystem {
- #CentOS systems:
- 'CentOS': {
- #Pick the right package provider:
- $package_provider = 'yum'
- }
- #Ubuntu systems:
- 'Ubuntu': {
- #Pick the right package provider:
- $package_provider = 'apt'
- }
- #Debian systems:
- 'Debian': {
- #Pick the right package provider:
- $package_provider = 'apt'
- }
- #Fail if we're on any other OS:
- default: { fail("${::operatingsystem} is not supported!") }
- }
- ##############################
- # Icinga 2 server parameters
- ##############################
- #Whether to manage the package repositories
- $manage_repos = true
- $use_debmon_repo = false
- $server_db_type = 'pgsql'
- $install_mail_utils_package = false
- #Database paramters
- $db_name = 'icinga2_data'
- $db_user = 'icinga2'
- $db_password = 'password'
- $db_host = 'localhost'
- $db_port = '5432'
- #Whether to install the plugin packages when the icinga2::server class is applied:
- $server_install_nagios_plugins = true
- ##############################
- # Icinga 2 server package parameters
- #Pick the right package parameters based on the OS:
- case $::operatingsystem {
- #CentOS systems:
- 'CentOS': {
- case $::operatingsystemmajrelease {
- '6': {
- #Icinga 2 server package
- $icinga2_server_package = 'icinga2'
- $icinga2_server_plugin_packages = ['nagios-plugins-nrpe', 'nagios-plugins-all', 'nagios-plugins-openmanage', 'nagios-plugins-check-updates']
- $icinga2_server_mail_package = 'mailx'
- }
- '7': {
- #Icinga 2 server package
- $icinga2_server_package = 'icinga2'
- $icinga2_server_plugin_packages = ['nagios-plugins-nrpe', 'nagios-plugins-all', 'nagios-plugins-openmanage', 'nagios-plugins-check-updates']
- $icinga2_server_mail_package = 'mailx'
- }
- #Fail if we're on any other CentOS release:
- default: { fail("${::operatingsystemmajrelease} is not a supported CentOS release!") }
- }
- }
- #Ubuntu systems:
- 'Ubuntu': {
- case $::operatingsystemrelease {
- #Ubuntu 12.04 doesn't have nagios-plugins-common or nagios-plugins-contrib packages available...
- '12.04': {
- $icinga2_server_package = 'icinga2'
- $icinga2_server_plugin_packages = ['nagios-plugins', 'nagios-plugins-basic', 'nagios-plugins-standard', 'nagios-snmp-plugins', 'nagios-plugins-extra', 'nagios-nrpe-plugin']
- $icinga2_server_mail_package = 'mailutils'
- #Specify '--no-install-recommends' so we don't inadvertently get Nagios 3 installed; it comes as a recommended package with most of the plugin packages:
- $server_plugin_package_install_options = '--no-install-recommends'
- }
- #...but 14.04 does:
- '14.04': {
- $icinga2_server_package = 'icinga2'
- $icinga2_server_plugin_packages = [ 'nagios-plugins', 'nagios-plugins-basic', 'nagios-plugins-common', 'nagios-plugins-standard', 'nagios-snmp-plugins', 'nagios-plugins-extra', 'nagios-plugins-contrib', 'nagios-nrpe-plugin']
- $icinga2_server_mail_package = 'mailutils'
- #Specify '--no-install-recommends' so we don't inadvertently get Nagios 3 installed; it comes as a recommended package with most of the plugin packages:
- $server_plugin_package_install_options = '--no-install-recommends'
- }
- #Fail if we're on any other Ubuntu release:
- default: { fail("${::operatingsystemmajrelease} is not a supported Ubuntu release version!") }
- }
- }
- #Debian systems:
- 'Debian': {
- case $::operatingsystemmajrelease {
- #Only tested on Debian7
- '7': {
- $icinga2_server_package = 'icinga2'
- $icinga2_server_plugin_packages = ['nagios-plugins', 'nagios-plugins-basic', 'nagios-plugins-standard', 'nagios-snmp-plugins', 'nagios-plugins-contrib', 'nagios-nrpe-plugin']
- $icinga2_server_mail_package = 'mailutils'
- #Specify '--no-install-recommends' so we don't inadvertently get Nagios 3 installed; it comes as a recommended package with most of the plugin packages:
- $server_plugin_package_install_options = '--no-install-recommends'
- }
- #Fail if we're on any other Debian release:
- default: { fail("${::operatingsystemmajrelease} is not a supported Debian release version!") }
- }
- }
- #Fail if we're on any other OS:
- default: { fail("${::operatingsystem} is not supported!") }
- }
- ##############################
- # Icinga 2 server config parameters
- case $::operatingsystem {
- #CentOS systems:
- 'CentOS': {
- #Settings for /etc/icinga2/:
- $etc_icinga2_owner = 'icinga'
- $etc_icinga2_group = 'icinga'
- $etc_icinga2_mode = '0750'
- #Settings for /etc/icinga2/icinga2.conf:
- $etc_icinga2_icinga2_conf_owner = 'icinga'
- $etc_icinga2_icinga2_conf_group = 'icinga'
- $etc_icinga2_icinga2_conf_mode = '0640'
- #Settings for /etc/icinga2/conf.d/
- $etc_icinga2_confd_owner = 'icinga'
- $etc_icinga2_confd_group = 'icinga'
- $etc_icinga2_confd_mode = '0750'
- #Settings for /etc/icinga2/features-available/:
- $etc_icinga2_features_available_owner = 'icinga'
- $etc_icinga2_features_available_group = 'icinga'
- $etc_icinga2_features_available_mode = '0750'
- #Settings for /etc/icinga2/features-enabled/:
- $etc_icinga2_features_enabled_owner = 'icinga'
- $etc_icinga2_features_enabled_group = 'icinga'
- $etc_icinga2_features_enabled_mode = '0750'
- #Settings for /etc/icinga2/pki/:
- $etc_icinga2_pki_owner = 'icinga'
- $etc_icinga2_pki_group = 'icinga'
- $etc_icinga2_pki_mode = '0750'
- #Settings for /etc/icinga2/scripts/:
- $etc_icinga2_scripts_owner = 'icinga'
- $etc_icinga2_scripts_group = 'icinga'
- $etc_icinga2_scripts_mode = '0750'
- #Settings for /etc/icinga2/zones.d/:
- $etc_icinga2_zonesd_owner = 'icinga'
- $etc_icinga2_zonesd_group = 'icinga'
- $etc_icinga2_zonesd_mode = '0750'
- #Settings for /etc/icinga2/objects/:
- $etc_icinga2_obejcts_owner = 'icinga'
- $etc_icinga2_obejcts_group = 'icinga'
- $etc_icinga2_obejcts_mode = '0750'
- #Settings for subdirectories of /etc/icinga2/objects/:
- $etc_icinga2_obejcts_sub_dir_owner = 'icinga'
- $etc_icinga2_obejcts_sub_dir_group = 'icinga'
- $etc_icinga2_obejcts_sub_dir_mode = '0750'
- }
- #Ubuntu and Debian systems:
- /(Ubuntu|Debian)/: {
- #Settings for /etc/icinga2/:
- $etc_icinga2_owner = 'root'
- $etc_icinga2_group = 'root'
- $etc_icinga2_mode = '0755'
- #Settings for /etc/icinga2/icinga2.conf:
- $etc_icinga2_icinga2_conf_owner = 'root'
- $etc_icinga2_icinga2_conf_group = 'root'
- $etc_icinga2_icinga2_conf_mode = '0644'
- #Settings for /etc/icinga2/conf.d/
- $etc_icinga2_confd_owner = 'root'
- $etc_icinga2_confd_group = 'root'
- $etc_icinga2_confd_mode = '0755'
- #Settings for /etc/icinga2/features-available/:
- $etc_icinga2_features_available_owner = 'root'
- $etc_icinga2_features_available_group = 'root'
- $etc_icinga2_features_available_mode = '0755'
- #Settings for /etc/icinga2/features-enabled/:
- $etc_icinga2_features_enabled_owner = 'root'
- $etc_icinga2_features_enabled_group = 'root'
- $etc_icinga2_features_enabled_mode = '0755'
- #Settings for /etc/icinga2/pki/:
- $etc_icinga2_pki_owner = 'root'
- $etc_icinga2_pki_group = 'root'
- $etc_icinga2_pki_mode = '0755'
- #Settings for /etc/icinga2/scripts/:
- $etc_icinga2_scripts_owner = 'root'
- $etc_icinga2_scripts_group = 'root'
- $etc_icinga2_scripts_mode = '0755'
- #Settings for /etc/icinga2/zones.d/:
- $etc_icinga2_zonesd_owner = 'root'
- $etc_icinga2_zonesd_group = 'root'
- $etc_icinga2_zonesd_mode = '0755'
- #Settings for /etc/icinga2/objects/:
- $etc_icinga2_obejcts_owner = 'root'
- $etc_icinga2_obejcts_group = 'root'
- $etc_icinga2_obejcts_mode = '0755'
- #Settings for subdirectories of /etc/icinga2/objects/:
- $etc_icinga2_obejcts_sub_dir_owner = 'root'
- $etc_icinga2_obejcts_sub_dir_group = 'root'
- $etc_icinga2_obejcts_sub_dir_mode = '0755'
- }
- #Fail if we're on any other OS:
- default: { fail("${::operatingsystem} is not supported!") }
- }
- ##################
- # Icinga 2 server service settings
- case $::operatingsystem {
- #Icinga 2 server daemon names for Red Had/CentOS systems:
- 'CentOS': {
- case $::operatingsystemmajrelease {
- '6': {
- $icinga2_server_service_name = 'icinga2'
- }
- '7': {
- $icinga2_server_service_name = 'icinga2'
- }
- #Fail if we're on any other CentOS release:
- default: { fail("${::operatingsystemmajrelease} is not a supported CentOS release!") }
- }
- }
- #Icinga 2 server daemon names for Ubuntu systems:
- 'Ubuntu': {
- case $::operatingsystemmajrelease {
- '12.04': {
- $icinga2_server_service_name = 'icinga2'
- }
- '14.04': {
- $icinga2_server_service_name = 'icinga2'
- }
- #Fail if we're on any other Ubuntu release:
- default: { fail("${::operatingsystemmajrelease} is not a supported Ubuntu release version!") }
- }
- }
- #Icinga 2 server daemon names for Debian systems:
- 'Debian': {
- case $::operatingsystemmajrelease {
- '7': {
- $icinga2_server_service_name = 'icinga2'
- }
- #Fail if we're on any other Debian release:
- default: { fail("${::operatingsystemmajrelease} is not a supported Debian release version!") }
- }
- }
- #Fail if we're on any other OS:
- default: { fail("${::operatingsystem} is not supported!") }
- }
- ##############################
- # Icinga 2 client parameters
- ##############################
- ##################
- # Icinga 2 client settings
- $nrpe_listen_port = '5666'
- $nrpe_log_facility = 'daemon'
- $nrpe_debug_level = '0'
- #in seconds:
- $nrpe_command_timeout = '60'
- #in seconds:
- $nrpe_connection_timeout = '300'
- #Note: because we use .join in the nrpe.cfg.erb template, this value *must* be an array
- $nrpe_allowed_hosts = ['127.0.0.1',]
- #Determines whether or not the NRPE daemon will allow clients to specify arguments to commands that are executed
- # *** ENABLING THIS OPTION IS A SECURITY RISK! ***
- # Defaults to NOT allow command arguments
- $allow_command_argument_processing = '0'
- case $::operatingsystem {
- #File and template variable names for Red Had/CentOS systems:
- 'CentOS': {
- $nrpe_config_basedir = '/etc/nagios'
- $nrpe_plugin_libdir = '/usr/lib64/nagios/plugins'
- $nrpe_pid_file_path = '/var/run/nrpe/nrpe.pid'
- $nrpe_user = 'nrpe'
- $nrpe_group = 'nrpe'
- }
- #File and template variable names for Ubuntu systems:
- 'Ubuntu': {
- $nrpe_config_basedir = '/etc/nagios'
- $nrpe_plugin_libdir = '/usr/lib/nagios/plugins'
- $nrpe_pid_file_path = '/var/run/nagios/nrpe.pid'
- $nrpe_user = 'nagios'
- $nrpe_group = 'nagios'
- }
- #File and template variable names for Ubuntu systems:
- 'Debian': {
- $nrpe_config_basedir = '/etc/nagios'
- $nrpe_plugin_libdir = '/usr/lib/nagios/plugins'
- $nrpe_pid_file_path = '/var/run/nagios/nrpe.pid'
- $nrpe_user = 'nagios'
- $nrpe_group = 'nagios'
- }
- #Fail if we're on any other OS:
- default: { fail("${::operatingsystem} is not supported!") }
- }
- ##################
- # Icinga 2 client package parameters
- case $::operatingsystem {
- #CentOS systems:
- 'CentOS': {
- case $::operatingsystemmajrelease {
- '6': {
- #Pick the right list of client packages:
- $icinga2_client_packages = ['nrpe', 'nagios-plugins-nrpe', 'nagios-plugins-all', 'nagios-plugins-openmanage', 'nagios-plugins-check-updates']
- }
- '7': {
- #Pick the right list of client packages:
- $icinga2_client_packages = ['nrpe', 'nagios-plugins-nrpe', 'nagios-plugins-all', 'nagios-plugins-openmanage', 'nagios-plugins-check-updates']
- }
- #Fail if we're on any other CentOS release:
- default: { fail("${::operatingsystemmajrelease} is not a supported CentOS release version!") }
- }
- }
- #Ubuntu systems:
- 'Ubuntu': {
- case $::operatingsystemrelease {
- #Ubuntu 12.04 doesn't have nagios-plugins-common or nagios-plugins-contrib packages available...
- '12.04': {
- $icinga2_client_packages = ['nagios-nrpe-server', 'nagios-plugins', 'nagios-plugins-basic', 'nagios-plugins-standard', 'nagios-snmp-plugins', 'nagios-plugins-extra', 'nagios-nrpe-plugin']
- #Specify '--no-install-recommends' so we don't inadvertently get Nagios 3 installed; it comes as a recommended package with most of the plugin packages:
- $client_plugin_package_install_options = '--no-install-recommends'
- }
- #...but 14.04 does:
- '14.04': {
- $icinga2_client_packages = ['nagios-nrpe-server', 'nagios-plugins', 'nagios-plugins-basic', 'nagios-plugins-common', 'nagios-plugins-standard', 'nagios-snmp-plugins', 'nagios-plugins-extra', 'nagios-plugins-contrib', 'nagios-nrpe-plugin']
- #Specify '--no-install-recommends' so we don't inadvertently get Nagios 3 installed; it comes as a recommended package with most of the plugin packages:
- $client_plugin_package_install_options = '--no-install-recommends'
- }
- #Fail if we're on any other Ubuntu release:
- default: { fail("${::operatingsystemmajrelease} is not a supported Ubuntu release version!") }
- }
- }
- #Debian systems:
- 'Debian': {
- case $::operatingsystemmajrelease {
- '7': {
- $icinga2_client_packages = ['nagios-nrpe-server', 'nagios-plugins', 'nagios-plugins-basic', 'nagios-plugins-standard', 'nagios-snmp-plugins', 'nagios-plugins-contrib', 'nagios-nrpe-plugin']
- #Specify '--no-install-recommends' so we don't inadvertently get Nagios 3 installed; it comes as a recommended package with most of the plugin packages:
- $client_plugin_package_install_options = '--no-install-recommends'
- }
- #Fail if we're on any other Debian release:
- default: { fail("${::operatingsystemmajrelease} is not a supported Debian release version!") }
- }
- }
- #Fail if we're on any other OS:
- default: { fail("${::operatingsystem} is not supported!") }
- }
- ##################
- # Icinga 2 client service parameters
- case $::operatingsystem {
- #Daemon names for Red Had/CentOS systems:
- 'CentOS': {
- $nrpe_daemon_name = 'nrpe'
- }
- #Daemon names for Ubuntu systems:
- 'Ubuntu': {
- $nrpe_daemon_name = 'nagios-nrpe-server'
- }
- #Daemon names for Debian systems:
- 'Debian': {
- $nrpe_daemon_name = 'nagios-nrpe-server'
- }
- #Fail if we're on any other OS:
- default: { fail("${::operatingsystem} is not supported!") }
- }
- }
|