diff --git a/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/init.pp b/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/init.pp index 343dc8c..60858cc 100644 --- a/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/init.pp +++ b/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/init.pp @@ -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, diff --git a/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/params.pp b/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/params.pp index 44f0b66..cb77912 100644 --- a/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/params.pp +++ b/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/params.pp @@ -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") diff --git a/pre_build_hook b/pre_build_hook index eb81f46..3569f1a 100755 --- a/pre_build_hook +++ b/pre_build_hook @@ -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