voxpupuli / puppet-snmp

Puppet module to manage Net-SNMP.
https://forge.puppet.com/puppet/snmp
Apache License 2.0
34 stars 131 forks source link

Possibility not to install snmptrapd #207

Open 3c2b2ff5 opened 5 years ago

3c2b2ff5 commented 5 years ago

Hi,

this is not an issue as though. But I would like to be able to install snmpd without snmptarp. It seems include snmp or class { 'snmp': } will always install snmptrap as well along with snmpd. How can I prevent installing the snmptrap?

Thanks

davidjmemmett commented 5 years ago

I can't get past this issue either, on Ubuntu 18.04, I get the following error:

Dec  2 14:12:08 puppet-test puppet-agent[10599]: (/Stage[main]/Snmp/Package[snmptrapd]/ensure) change from 'purged' to 'present' failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install snmptrapd' returned 100: Reading package lists...
Dec  2 14:12:08 puppet-test puppet-agent[10599]: (/Stage[main]/Snmp/Package[snmptrapd]/ensure) Building dependency tree...
Dec  2 14:12:08 puppet-test puppet-agent[10599]: (/Stage[main]/Snmp/Package[snmptrapd]/ensure) Reading state information...
Dec  2 14:12:08 puppet-test puppet-agent[10599]: (/Stage[main]/Snmp/Package[snmptrapd]/ensure) Package snmptrapd is not available, but is referred to by another package.
Dec  2 14:12:08 puppet-test puppet-agent[10599]: (/Stage[main]/Snmp/Package[snmptrapd]/ensure) This may mean that the package is missing, has been obsoleted, or
Dec  2 14:12:08 puppet-test puppet-agent[10599]: (/Stage[main]/Snmp/Package[snmptrapd]/ensure) is only available from another source
Dec  2 14:12:08 puppet-test puppet-agent[10599]: (/Stage[main]/Snmp/Package[snmptrapd]/ensure)
Dec  2 14:12:08 puppet-test puppet-agent[10599]: (/Stage[main]/Snmp/Package[snmptrapd]/ensure) E: Package 'snmptrapd' has no installation candidate
Dec  2 14:12:08 puppet-test puppet-agent[10599]: (/Stage[main]/Snmp/File[snmptrapd.sysconfig]) Dependency Package[snmptrapd] has failures: true
Dec  2 14:12:08 puppet-test puppet-agent[10599]: (/Stage[main]/Snmp/File[snmptrapd.sysconfig]) Skipping because of failed dependencies
Dec  2 14:12:08 puppet-test puppet-agent[10599]: (/Stage[main]/Snmp/Service[snmptrapd]) Skipping because of failed dependencies
Dec  2 14:12:08 puppet-test puppet-agent[10599]: Applied catalog in 0.16 seconds
alaunay commented 4 years ago

In the module file: data/os/Debian/18.04.yaml

If you add a line: snmp::snmptrapd_package_name: ~

snmptrapd won't be installed.

Not perfect though, I'd very much like not to touch the module :/

ubellavance commented 4 years ago

@alaunay have you tried putting this line in your relevant hiera yaml file? If you don't use hiera, you can set this in your manifest

snmptrapd_package_name        => undef,
alaunay commented 4 years ago

Hello @ubellavance , yes, I tried. It seems it's superseded by the hiera data from the module. I did not try /that/ hard though, so I'm not 100% sure. I'm sure that by adding a 7.yaml in the same directory as 18.04 or 9, with the line above, it does the trick (Debian Wheezy does not have a separated snmptrapd package, and yes, I still have a few of those).

ubellavance commented 4 years ago

Maybe you should create a separate issue for that... I'm not a super-pro with Puppet but that sure looks weird.