-
-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move zabbixapi gem installation into own class
- Loading branch information
Showing
4 changed files
with
65 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# @summary This will install the zabbixapi gem. | ||
# | ||
# @param zabbix_version This is the zabbix version. | ||
# @param puppetgem Provider for the zabbixapi gem package. | ||
class zabbix::zabbixapi( | ||
$zabbix_version = $zabbix::params::zabbix_version, | ||
$puppetgem = $zabbix::params::puppetgem, | ||
) inherits zabbix::params { | ||
# Determine correct zabbixapi version. | ||
case $zabbix_version { | ||
/^[56]\.[024]/: { | ||
$zabbixapi_version = '5.0.0-alpha1' | ||
} | ||
default: { | ||
fail("Zabbix ${zabbix_version} is not supported!") | ||
} | ||
} | ||
|
||
$compile_packages = $facts['os']['family'] ? { | ||
'RedHat' => [ 'make', 'gcc-c++', 'rubygems', 'ruby'], | ||
'Debian' => [ 'make', 'g++', 'ruby-dev', 'ruby', 'pkg-config',], | ||
default => [], | ||
} | ||
ensure_packages($compile_packages) | ||
|
||
# Installing the zabbixapi gem package. We need this gem for | ||
# communicating with the zabbix-api. This is way better then | ||
# doing it ourself. | ||
package { 'zabbixapi': | ||
ensure => $zabbixapi_version, | ||
provider => $puppetgem, | ||
} | ||
|
||
} |
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