Merge pull request #3 from adamcstephens/make_manage_repos_work

make manage_repos parameter work
This commit is contained in:
nickchappell 2014-08-20 13:53:27 -07:00
commit ee23ecebf7
3 changed files with 38 additions and 30 deletions

View file

@ -24,6 +24,8 @@ class icinga2::server (
$server_install_nagios_plugins = $icinga2::params::server_install_nagios_plugins, $server_install_nagios_plugins = $icinga2::params::server_install_nagios_plugins,
) inherits icinga2::params { ) inherits icinga2::params {
validate_bool($manage_repos)
#Pick set the right path where we can find the DB schema based on the OS... #Pick set the right path where we can find the DB schema based on the OS...
case $operatingsystem { case $operatingsystem {
'RedHat', 'CentOS': { 'RedHat', 'CentOS': {
@ -55,4 +57,4 @@ class icinga2::server (
class {'icinga2::server::config':} ~> class {'icinga2::server::config':} ~>
class {'icinga2::server::service':} class {'icinga2::server::service':}
} }

View file

@ -30,36 +30,38 @@ class icinga2::server::install::repos inherits icinga2::server {
include icinga2::server include icinga2::server
case $operatingsystem { if $manage_repos == true {
#Red Hat/CentOS systems: case $::operatingsystem {
'RedHat', 'CentOS': { #Red Hat/CentOS systems:
'RedHat', 'CentOS': {
#Add the official Icinga Yum repository: http://packages.icinga.org/epel/
yumrepo { 'icinga2_yum_repo': #Add the official Icinga Yum repository: http://packages.icinga.org/epel/
baseurl => "http://packages.icinga.org/epel/${operatingsystemmajrelease}/release/", yumrepo { 'icinga2_yum_repo':
descr => "Icinga 2 Yum repository", baseurl => "http://packages.icinga.org/epel/${::operatingsystemmajrelease}/release/",
enabled => 1, descr => 'Icinga 2 Yum repository',
gpgcheck => 1, enabled => 1,
gpgkey => 'http://packages.icinga.org/icinga.key' gpgcheck => 1,
gpgkey => 'http://packages.icinga.org/icinga.key'
}
} }
}
#Debian/Ubuntu systems:
#Debian/Ubuntu systems: /^(Debian|Ubuntu)$/: {
/^(Debian|Ubuntu)$/: { #Add the Icinga 2 snapshots apt repo for Ubuntu Saucy Salamander:
#Add the Icinga 2 snapshots apt repo for Ubuntu Saucy Salamander: apt::source { "icinga2_ubuntu_${::lsbdistcodename}_release_apt":
apt::source { "icinga2_ubuntu_${lsbdistcodename}_release_apt": location => 'http://packages.icinga.org/ubuntu',
location => 'http://packages.icinga.org/ubuntu', release => "icinga-${::lsbdistcodename}",
release => "icinga-${lsbdistcodename}", repos => 'main',
repos => 'main', required_packages => 'debian-keyring debian-archive-keyring',
required_packages => 'debian-keyring debian-archive-keyring', key => '34410682',
key => '34410682', key_source => 'http://packages.icinga.org/icinga.key',
key_source => 'http://packages.icinga.org/icinga.key', include_src => true
include_src => true }
} }
#Fail if we're on any other OS:
default: { fail("${::operatingsystem} is not supported!") }
} }
#Fail if we're on any other OS:
default: { fail("${operatingsystem} is not supported!") }
} }
} }
@ -148,4 +150,4 @@ class icinga2::server::install::execs inherits icinga2::server {
default: { fail("${server_db_type} is not supported!") } default: { fail("${server_db_type} is not supported!") }
} }
} }

View file

@ -11,7 +11,7 @@
{ {
"operatingsystem": "CentOS", "operatingsystem": "CentOS",
"operatingsystemrelease": [ "operatingsystemrelease": [
"6", "6"
] ]
}, },
{ {
@ -33,6 +33,10 @@
{ {
"name": "puppetlabs/apt", "name": "puppetlabs/apt",
"version_requirement": ">= 1.5.0" "version_requirement": ">= 1.5.0"
},
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 4.3.2"
} }
] ]
} }