-
-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Allows installation of 5.6 version of Collectd, 5.7 or RC (current master branch) * Refactor repo management behaviour into it's own classes * Add parameter to specify version from bleeding edge repos from CI
- Loading branch information
Showing
9 changed files
with
139 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# collectd::repo | ||
# Handle package repo configuration | ||
class collectd::repo { | ||
|
||
if $collectd::manage_repo { | ||
if $::collectd::ci_package_repo != undef { | ||
validate_re($::collectd::ci_package_repo, [ '^5.4', '^5.5', '^5.6', '5.7', '^master' ], "ci_package_repo has to match '5.4', '5.5', '5.6', '5.7' or 'master' (RC for next release), got: ${::collectd::ci_package_repo}") | ||
} | ||
|
||
$osfamily_downcase = downcase($::osfamily) | ||
|
||
if defined("::collectd::repo::${osfamily_downcase}") { | ||
include "::collectd::repo::${osfamily_downcase}" | ||
} else { | ||
notify{"You have asked to manage_repo on a system that doesn't have a repo class specified: ${::osfamily}":} | ||
} | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
class collectd::repo::debian { | ||
|
||
contain ::apt | ||
|
||
if $::collectd::ci_package_repo { | ||
|
||
apt::source { 'collectd-ci': | ||
location => 'https://pkg.ci.collectd.org/deb/', | ||
repos => "collectd-${$::collectd::ci_package_repo}", | ||
key => { | ||
'id' => 'F806817DC3F5EA417F9FA2963994D24FB8543576', | ||
'server' => 'pgp.mit.edu', | ||
}, | ||
} | ||
} else { | ||
if $::operatingsystem == 'Debian' { | ||
warning('Youre trying to use the Ubuntu PPA on a Debian Server, which may cause errors') | ||
warning('We recomend you use the $ci_package_repo parameter if you with to use an upstream repo on Debian') | ||
} else { | ||
apt::source { 'ppa_collectd': | ||
location => 'http://ppa.launchpad.net/collectd/collectd-5.5/ubuntu', | ||
repos => 'main', | ||
key => { | ||
'id' => '7543C08D555DC473B9270ACDAF7ECBB3476ACEB3', | ||
'server' => 'keyserver.ubuntu.com', | ||
}, | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
class collectd::repo::redhat { | ||
|
||
if $::collectd::ci_package_repo { | ||
|
||
yumrepo { 'collectd-ci': | ||
ensure => present, | ||
enabled => '1', | ||
baseurl => "https://pkg.ci.collectd.org/rpm/collectd-${::collectd::ci_package_repo}/epel-${::operatingsystemmajrelease}-${::architecture}", | ||
gpgkey => 'https://pkg.ci.collectd.org/pubkey.asc', | ||
} | ||
|
||
} else { | ||
|
||
# TODO: Replace this with EPEL module requirement in Major version bump | ||
|
||
if !defined(Yum::Install['epel-release']) { | ||
yum::install { 'epel-release': | ||
ensure => 'present', | ||
source => "https://dl.fedoraproject.org/pub/epel/epel-release-latest-${::operatingsystemmajrelease}.noarch.rpm", | ||
before => Package[$::collectd::package_name], | ||
} | ||
} | ||
|
||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
--- | ||
collectd_version: '5.5.0' | ||
python_dir: '/usr/local/lib/python2.7/dist-packages' | ||
python_dir: '/usr/local/lib/python2.7/dist-packages' | ||
operatingsystem: 'Debian' | ||
lsbdistid: 'Debian' | ||
lsbdistcodename: 'wheezy' |