Merged in support for Red Hat operating systems.
Merged in from: https://github.com/Icinga/puppet-icinga2/pull/83/
This commit is contained in:
parent
9b3abbd2ff
commit
099b308c4d
5 changed files with 39 additions and 14 deletions
|
@ -38,6 +38,15 @@ For Ubuntu systems, this module requires the [Puppet Labs apt module](https://gi
|
|||
|
||||
On EL-based systems (CentOS, Red Hat Enterprise Linux, Fedora, etc.), the [EPEL package repository](https://fedoraproject.org/wiki/EPEL) is required. You can also use the [icinga2::nrpe class](#nrpe-usage) to set up NRPE on CentOS 5. It is discouraged to set up Icinga2 Server on this old of a distribution. You are encouraged to use at least CentOS 6 or higher.
|
||||
|
||||
####Note for RedHat
|
||||
|
||||
If you are using RedHat Satellite server, set
|
||||
<pre>
|
||||
$manage_repos = false
|
||||
</pre>
|
||||
|
||||
in `icinga2::server` class and make sure, you have a channel set up with the contents of the icinga2 repository and the needed packages from EPEL. If you leave it at true, the EPEL repository will be used directly.
|
||||
|
||||
If you would like to use the `icinga2::object` defined types as [exported resources](https://docs.puppetlabs.com/guides/exported_resources.html), you'll need to have your Puppet master set up with PuppetDB. See the Puppet Labs documentation for more info: [Docs: PuppetDB](https://docs.puppetlabs.com/puppetdb/)
|
||||
|
||||
###Server requirements
|
||||
|
|
|
@ -18,14 +18,20 @@ class icinga2::params {
|
|||
##################
|
||||
# Icinga 2 common package parameters
|
||||
case $::operatingsystem {
|
||||
#CentOS systems:
|
||||
#CentOS or RedHat systems:
|
||||
'CentOS', 'RedHat': {
|
||||
#Pick the right package provider:
|
||||
$package_provider = 'yum'
|
||||
}
|
||||
|
||||
#RedHat systems:
|
||||
'RedHat': {
|
||||
#Pick the right package provider:
|
||||
$package_provider = 'yum'
|
||||
}
|
||||
|
||||
#Ubuntu systems:
|
||||
'Ubuntu': {
|
||||
#Ubuntu systems:
|
||||
'Ubuntu': {
|
||||
#Pick the right package provider:
|
||||
$package_provider = 'apt'
|
||||
}
|
||||
|
@ -95,9 +101,9 @@ class icinga2::params {
|
|||
}
|
||||
}
|
||||
|
||||
#Ubuntu systems:
|
||||
'Ubuntu': {
|
||||
case $::operatingsystemrelease {
|
||||
#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'
|
||||
|
@ -143,7 +149,7 @@ class icinga2::params {
|
|||
# Icinga 2 server config parameters
|
||||
|
||||
case $::operatingsystem {
|
||||
#CentOS systems:
|
||||
#CentOS or RedHat systems:
|
||||
'CentOS', 'RedHat': {
|
||||
#Settings for /etc/icinga2/:
|
||||
$etc_icinga2_owner = 'icinga'
|
||||
|
@ -322,6 +328,7 @@ class icinga2::params {
|
|||
$nrpe_user = 'nrpe'
|
||||
$nrpe_group = 'nrpe'
|
||||
}
|
||||
|
||||
#File and template variable names for Ubuntu systems:
|
||||
'Ubuntu': {
|
||||
$nrpe_config_basedir = '/etc/nagios'
|
||||
|
@ -331,6 +338,7 @@ class icinga2::params {
|
|||
$nrpe_user = 'nagios'
|
||||
$nrpe_group = 'nagios'
|
||||
}
|
||||
|
||||
#File and template variable names for Ubuntu systems:
|
||||
'Debian': {
|
||||
$nrpe_config_basedir = '/etc/nagios'
|
||||
|
@ -340,14 +348,15 @@ class icinga2::params {
|
|||
$nrpe_user = 'nagios'
|
||||
$nrpe_group = 'nagios'
|
||||
}
|
||||
#Fail if we're on any other OS:
|
||||
|
||||
#Fail if we're on any other OS:
|
||||
default: { fail("${::operatingsystem} is not supported!") }
|
||||
}
|
||||
|
||||
##################
|
||||
# Icinga 2 client package parameters
|
||||
case $::operatingsystem {
|
||||
#CentOS systems:
|
||||
#CentOS or RedHat systems:
|
||||
'CentOS', 'RedHat': {
|
||||
case $::operatingsystemmajrelease {
|
||||
'5': {
|
||||
|
|
|
@ -44,7 +44,7 @@ class icinga2::server (
|
|||
|
||||
#Pick set the right path where we can find the DB schema based on the OS...
|
||||
case $::operatingsystem {
|
||||
'CentOS': {
|
||||
'CentOS','RedHat': {
|
||||
#...and database that the user picks
|
||||
case $server_db_type {
|
||||
'mysql': { $server_db_schema_path = '/usr/share/icinga2-ido-mysql/schema/mysql.sql' }
|
||||
|
|
|
@ -32,9 +32,8 @@ class icinga2::server::install::repos inherits icinga2::server {
|
|||
|
||||
if $manage_repos == true {
|
||||
case $::operatingsystem {
|
||||
#CentOS systems:
|
||||
#CentOS or RedHat systems:
|
||||
'CentOS', 'RedHat': {
|
||||
|
||||
#Add the official Icinga Yum repository: http://packages.icinga.org/epel/
|
||||
yumrepo { 'icinga2_yum_repo':
|
||||
baseurl => "http://packages.icinga.org/epel/${::operatingsystemmajrelease}/release/",
|
||||
|
@ -45,8 +44,8 @@ class icinga2::server::install::repos inherits icinga2::server {
|
|||
}
|
||||
}
|
||||
|
||||
#Ubuntu systems:
|
||||
'Ubuntu': {
|
||||
#Ubuntu systems:
|
||||
'Ubuntu': {
|
||||
#Include the apt module's base class so we can...
|
||||
include apt
|
||||
#...use the apt module to add the Icinga 2 PPA from launchpad.net:
|
||||
|
|
|
@ -16,6 +16,14 @@
|
|||
"7"
|
||||
]
|
||||
},
|
||||
{
|
||||
"operatingsystem": "RedHat",
|
||||
"operatingsystemmajrelease": [
|
||||
"5",
|
||||
"6",
|
||||
"7"
|
||||
]
|
||||
},
|
||||
{
|
||||
"operatingsystem": "Debian",
|
||||
"operatingsystemmajrelease": [
|
||||
|
|
Loading…
Reference in a new issue