Puppet Class: zabbix::zabbixapi

Inherits:
zabbix::params
Defined in:
manifests/zabbixapi.pp

Summary

This will install the zabbixapi gem.

Overview

Parameters:

  • zabbix_version (Any) (defaults to: $zabbix::params::zabbix_version)

    This is the zabbix version.

  • puppetgem (Any) (defaults to: $zabbix::params::puppetgem)

    Provider for the zabbixapi gem package.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'manifests/zabbixapi.pp', line 5

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,
  }
}