Browse Source

Fix separated snmptrapd package for MOS 10.0

Change-Id: I7c1010d515ade8d1c0a361ec5e525b488af28ba0
Olivier Bourdon 2 years ago
parent
commit
e2e77a2141

+ 10
- 0
deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/init.pp View File

@@ -20,6 +20,7 @@ class plugin_zabbix_snmptrapd {
20 20
   $service_name     = $plugin_zabbix_snmptrapd::params::service_name
21 21
   $daemon_pkg_name  = $plugin_zabbix_snmptrapd::params::daemon_pkg_name
22 22
   $utils_pkg_name   = $plugin_zabbix_snmptrapd::params::utils_pkg_name
23
+  $trapd_pkg_name   = $plugin_zabbix_snmptrapd::params::trapd_pkg_name
23 24
 
24 25
   $plugin_settings  = hiera('zabbix_snmptrapd')
25 26
 
@@ -47,6 +48,15 @@ class plugin_zabbix_snmptrapd {
47 48
     name   => $utils_pkg_name,
48 49
   }
49 50
 
51
+  # The following is true on Xenial based systems (MOS >= 10.0)
52
+  if $trapd_pkg_name {
53
+    package { $trapd_pkg_name:
54
+      ensure => 'present',
55
+      name   => $trapd_pkg_name,
56
+    }
57
+    Package[$trapd_pkg_name] -> Package[$daemon_pkg_name]
58
+  }
59
+
50 60
   # The following resource overwrites default initscript for snmptrapd.
51 61
   # Version provided by the plugin supports namespaces.
52 62
   # If there is a need to run snmptrad in a specific namespace,

+ 10
- 2
deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/params.pp View File

@@ -15,16 +15,24 @@
15 15
 #
16 16
 class plugin_zabbix_snmptrapd::params {
17 17
 
18
+  $fuel_version = 0 + hiera('fuel_version')
19
+
18 20
   case $::osfamily {
19 21
     'Debian': {
20 22
       $service_name     = 'snmpd'
21 23
       $daemon_pkg_name  = 'snmpd'
22
-      $utils_pkg_name    = 'snmp'
24
+      $utils_pkg_name   = 'snmp'
25
+      if $fuel_version >= 10.0 {
26
+        $trapd_pkg_name   = 'snmptrapd'
27
+      } else {
28
+        $trapd_pkg_name   = undef
29
+      }
23 30
     }
24 31
     'RedHat': {
25 32
       $service_name     = 'snmptrapd'
26 33
       $daemon_pkg_name  = 'net-snmp'
27
-      $utils_pkg_name    = 'snmp'
34
+      $utils_pkg_name   = 'snmp'
35
+      $trapd_pkg_name   = undef
28 36
     }
29 37
     default: {
30 38
       fail("unsuported osfamily ${::osfamily}, currently Debian and RedHat are the only supported platforms")

+ 1
- 0
pre_build_hook View File

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

Loading…
Cancel
Save