Fix separated snmptrapd package for MOS 10.0

Change-Id: I7c1010d515ade8d1c0a361ec5e525b488af28ba0
This commit is contained in:
Olivier Bourdon 2017-02-22 08:36:03 +01:00
parent 8a2a86d679
commit e2e77a2141
3 changed files with 21 additions and 2 deletions

View File

@ -20,6 +20,7 @@ class plugin_zabbix_snmptrapd {
$service_name = $plugin_zabbix_snmptrapd::params::service_name
$daemon_pkg_name = $plugin_zabbix_snmptrapd::params::daemon_pkg_name
$utils_pkg_name = $plugin_zabbix_snmptrapd::params::utils_pkg_name
$trapd_pkg_name = $plugin_zabbix_snmptrapd::params::trapd_pkg_name
$plugin_settings = hiera('zabbix_snmptrapd')
@ -47,6 +48,15 @@ class plugin_zabbix_snmptrapd {
name => $utils_pkg_name,
}
# The following is true on Xenial based systems (MOS >= 10.0)
if $trapd_pkg_name {
package { $trapd_pkg_name:
ensure => 'present',
name => $trapd_pkg_name,
}
Package[$trapd_pkg_name] -> Package[$daemon_pkg_name]
}
# The following resource overwrites default initscript for snmptrapd.
# Version provided by the plugin supports namespaces.
# If there is a need to run snmptrad in a specific namespace,

View File

@ -15,16 +15,24 @@
#
class plugin_zabbix_snmptrapd::params {
$fuel_version = 0 + hiera('fuel_version')
case $::osfamily {
'Debian': {
$service_name = 'snmpd'
$daemon_pkg_name = 'snmpd'
$utils_pkg_name = 'snmp'
$utils_pkg_name = 'snmp'
if $fuel_version >= 10.0 {
$trapd_pkg_name = 'snmptrapd'
} else {
$trapd_pkg_name = undef
}
}
'RedHat': {
$service_name = 'snmptrapd'
$daemon_pkg_name = 'net-snmp'
$utils_pkg_name = 'snmp'
$utils_pkg_name = 'snmp'
$trapd_pkg_name = undef
}
default: {
fail("unsuported osfamily ${::osfamily}, currently Debian and RedHat are the only supported platforms")

View File

@ -39,6 +39,7 @@ download_package "$DEB_TRUSTY_REPO" $SNMP_TRUSTY_PACKAGES $COMMON_PACKAGES
SNMP_XENIAL_VERSION="5.7.3+dfsg-1ubuntu4"
SNMP_XENIAL_PACKAGES="http://archive.ubuntu.com/ubuntu/pool/universe/n/net-snmp/libsnmp-perl_${SNMP_XENIAL_VERSION}_amd64.deb \
http://archive.ubuntu.com/ubuntu/pool/universe/n/net-snmp/snmptrapd_${SNMP_XENIAL_VERSION}_amd64.deb \
http://archive.ubuntu.com/ubuntu/pool/main/n/net-snmp/snmpd_${SNMP_XENIAL_VERSION}_amd64.deb \
http://archive.ubuntu.com/ubuntu/pool/main/n/net-snmp/snmp_${SNMP_XENIAL_VERSION}_amd64.deb"
download_package "$DEB_XENIAL_REPO" $SNMP_XENIAL_PACKAGES $COMMON_PACKAGES