Issue #7583 has been updated by R.I. Pienaar. Branch set to ripienaar/feature/master/7583
Doing this in a few places. At the most basic any agent - SimpleRPC or not - can simply define an activate? method: <pre> def self.activate? Facts["kernel"] == "Linux" end </pre> If this returns true or raises an exception the plugin wont activate. In SimpleRPC agents there is a default activate? method that will check for a config param like: <pre> plugins.foo.activate_agent = false </pre> You can also put in /etc/mcollective/plugins.d/foo.cfg: <pre> activate_agent = false </pre> Finally when writing an agent I made a helper that fits in well with the action, authorized_by etc model: <pre> activate_when do Facts["kernel"] == "Linux" end </pre> Any false or exception will prevent the agents from activating. Code is functional but need tests and docs. ---------------------------------------- Feature #7583: Plugin Activation - Configuration and Supportability Checks https://projects.puppetlabs.com/issues/7583 Author: Ken Barber Status: Accepted Priority: Normal Assignee: R.I. Pienaar Category: Core Target version: 1.3.x Keywords: Branch: ripienaar/feature/master/7583 Affected mCollective version: MCollective plugins that exist on a system should have a mechanism for being enabled/disabled based on a) checks that the plugin does itself to make sure it _can_ run - like checking for any dependencies they need or b) a user defined switch in a configuration file somewhere. This way - we can distribute plugins on all systems using something trivial like Puppet pluginsync and have an administrator either disable/enable them selectively. It will also mean that plugins that could not possibly work - like an iptables plugin on FreeBSD - will disable itself. One technique would be to provide a method in the plugin called 'activate?' which when called returns a true or false. The abstract parent provides behaviour which checks a configuration file for example - but other checks such as searching for executables can also be done. We could also mimic the :contraint behaviour in Puppet providers for certain plugins to only work based on facts checks such as supported operating systems. -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
