From de61c1a14f81f627c3324c384ba1c391334993dc Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Mon, 18 Aug 2014 09:28:44 -0400 Subject: [PATCH 1/2] make manage_repos parameter work --- manifests/server.pp | 4 ++- manifests/server/install.pp | 58 +++++++++++++++++++------------------ 2 files changed, 33 insertions(+), 29 deletions(-) diff --git a/manifests/server.pp b/manifests/server.pp index cd731c3..fcd8956 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -24,6 +24,8 @@ class icinga2::server ( $server_install_nagios_plugins = $icinga2::params::server_install_nagios_plugins, ) inherits icinga2::params { + validate_bool($manage_repos) + #Pick set the right path where we can find the DB schema based on the OS... case $operatingsystem { 'RedHat', 'CentOS': { @@ -55,4 +57,4 @@ class icinga2::server ( class {'icinga2::server::config':} ~> class {'icinga2::server::service':} -} \ No newline at end of file +} diff --git a/manifests/server/install.pp b/manifests/server/install.pp index 22ee84c..de4d669 100644 --- a/manifests/server/install.pp +++ b/manifests/server/install.pp @@ -30,36 +30,38 @@ class icinga2::server::install::repos inherits icinga2::server { include icinga2::server - case $operatingsystem { - #Red Hat/CentOS systems: - 'RedHat', 'CentOS': { - - #Add the official Icinga Yum repository: http://packages.icinga.org/epel/ - yumrepo { 'icinga2_yum_repo': - baseurl => "http://packages.icinga.org/epel/${operatingsystemmajrelease}/release/", - descr => "Icinga 2 Yum repository", - enabled => 1, - gpgcheck => 1, - gpgkey => 'http://packages.icinga.org/icinga.key' + if $manage_repos == true { + case $::operatingsystem { + #Red Hat/CentOS systems: + 'RedHat', 'CentOS': { + + #Add the official Icinga Yum repository: http://packages.icinga.org/epel/ + yumrepo { 'icinga2_yum_repo': + baseurl => "http://packages.icinga.org/epel/${::operatingsystemmajrelease}/release/", + descr => 'Icinga 2 Yum repository', + enabled => 1, + gpgcheck => 1, + gpgkey => 'http://packages.icinga.org/icinga.key' + } } - } - - #Debian/Ubuntu systems: - /^(Debian|Ubuntu)$/: { - #Add the Icinga 2 snapshots apt repo for Ubuntu Saucy Salamander: - apt::source { "icinga2_ubuntu_${lsbdistcodename}_release_apt": - location => 'http://packages.icinga.org/ubuntu', - release => "icinga-${lsbdistcodename}", - repos => 'main', - required_packages => 'debian-keyring debian-archive-keyring', - key => '34410682', - key_source => 'http://packages.icinga.org/icinga.key', - include_src => true + + #Debian/Ubuntu systems: + /^(Debian|Ubuntu)$/: { + #Add the Icinga 2 snapshots apt repo for Ubuntu Saucy Salamander: + apt::source { "icinga2_ubuntu_${::lsbdistcodename}_release_apt": + location => 'http://packages.icinga.org/ubuntu', + release => "icinga-${::lsbdistcodename}", + repos => 'main', + required_packages => 'debian-keyring debian-archive-keyring', + key => '34410682', + key_source => 'http://packages.icinga.org/icinga.key', + 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!") } } -} \ No newline at end of file +} From a7a0171781aee061eb322c70c79608cc7b630cab Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Wed, 20 Aug 2014 16:45:15 -0400 Subject: [PATCH 2/2] add puppetlabs/stdlib requirement uses current supported release (4.3.2) --- metadata.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 790625d..8cd8220 100644 --- a/metadata.json +++ b/metadata.json @@ -11,7 +11,7 @@ { "operatingsystem": "CentOS", "operatingsystemrelease": [ - "6", + "6" ] }, { @@ -33,6 +33,10 @@ { "name": "puppetlabs/apt", "version_requirement": ">= 1.5.0" + }, + { + "name": "puppetlabs/stdlib", + "version_requirement": ">= 4.3.2" } ] }