Puppet Class: zabbix::repo
- Inherits:
- zabbix::params
- Defined in:
- manifests/repo.pp
Overview
Class: zabbix::repo
If enabled, this will install the repository used for installing zabbix
Please note:
This class will be called from zabbix::server, zabbix::proxy and
zabbix::agent. No need for calling this class manually.
Parameters
- manage_repo
-
When true, it will create repository for installing the server.
- zabbix_version
-
This is the zabbix version.
Authors
Author Name:
ikben@werner-dijkerman.nl
Tim Meusel <tim@bastelfreak.de>
Copyright
Copyright 2014 Werner Dijkerman
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'manifests/repo.pp', line 28
class zabbix::repo (
$manage_repo = $zabbix::params::manage_repo,
$manage_apt = $zabbix::params::manage_apt,
$repo_location = $zabbix::params::repo_location,
$zabbix_version = $zabbix::params::zabbix_version,
) inherits zabbix::params {
if ($manage_repo) {
case $facts['os']['name'] {
'PSBM' : {
$majorrelease = '6'
}
'Amazon' : {
$majorrelease = '6'
}
'oraclelinux' : {
$majorrelease = $facts['os']['release']['major']
}
default : {
$majorrelease = $facts['os']['release']['major']
}
}
case $facts['os']['family'] {
'RedHat' : {
# Zabbix-3.2 and newer RPMs are signed with the GPG key
if versioncmp($zabbix_version, '3.2') < 0 {
$gpgkey_zabbix = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX'
$gpgkey_nonsupported = $gpgkey_zabbix
}
else {
$gpgkey_zabbix = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591'
$gpgkey_nonsupported = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-79EA5ED4'
}
yumrepo { 'zabbix':
name => "Zabbix_${majorrelease}_${facts['os']['architecture']}",
descr => "Zabbix_${majorrelease}_${facts['os']['architecture']}",
baseurl => "https://repo.zabbix.com/zabbix/${zabbix_version}/rhel/${majorrelease}/\$basearch/",
gpgcheck => '1',
gpgkey => $gpgkey_zabbix,
priority => '1',
}
yumrepo { 'zabbix-nonsupported':
name => "Zabbix_nonsupported_${majorrelease}_${facts['os']['architecture']}",
descr => "Zabbix_nonsupported_${majorrelease}_${facts['os']['architecture']}",
baseurl => "https://repo.zabbix.com/non-supported/rhel/${majorrelease}/\$basearch/",
gpgcheck => '1',
gpgkey => $gpgkey_nonsupported,
priority => '1',
}
}
'Debian' : {
if ($manage_apt) {
# We would like to provide the repos with https urls instead of http
# this requires the apt-transport-https package, but we don't want to manage
# that package here. That should be handled in a profile :(
# somebody should implement https here but make it optional
include apt
}
if ($facts['os']['architecture'] == 'armv6l') {
apt::source { 'zabbix':
location => 'http://naizvoru.com/raspbian/zabbix',
repos => 'main',
key => {
'id' => 'BC274A7EA7FD5DD267C9A18FD54A213C80E871A7',
'source' => 'https://naizvoru.com/raspbian/zabbix/conf/boris@steki.net.gpg.key',
}
,
include => {
'src' => false,
}
,
}
} else {
$operatingsystem = downcase($facts['os']['name'])
case $facts['os']['release']['full'] {
/\/sid$/ : { $releasename = regsubst($facts['os']['release']['full'], '/sid$', '') }
default : { $releasename = $facts['lsbdistcodename'] }
}
apt::key { 'zabbix-FBABD5F':
id => 'FBABD5FB20255ECAB22EE194D13D58E479EA5ED4',
source => 'https://repo.zabbix.com/zabbix-official-repo.key',
}
apt::key { 'zabbix-A1848F5':
id => 'A1848F5352D022B9471D83D0082AB56BA14FE591',
source => 'https://repo.zabbix.com/zabbix-official-repo.key',
}
apt::source { 'zabbix':
location => "http://repo.zabbix.com/zabbix/${zabbix_version}/${operatingsystem}/",
repos => 'main',
release => $releasename,
require => [
Apt_key['zabbix-FBABD5F'],
Apt_key['zabbix-A1848F5'],
],
}
}
Apt::Source['zabbix'] -> Package<|tag == 'zabbix'|>
Class['Apt::Update'] -> Package<|tag == 'zabbix'|>
}
default : {
fail("Managing a repo on ${facts['os']['family']} is currently not implemented")
}
}
} # end if ($manage_repo)
}
|