Puppet: System Administration Automated

Support

Plugins in Modules

This page describes the deployment of custom facts and types via modules. It is supported in 0.24 onwards and modifies the pluginsync model supported in releases prior to 0.24. It is NOT supported in earlier releases of Puppet but may be present as a patch in some older Debian Puppet packages.

Usage

Instead of using the existing pluginsync mechanism custom types and facts are now stored in modules. These custom types and facts are then gathered together and distributed via a file mount on your Puppet master called plugins.

To enable module distribution you need to make changes on both the Puppet master and the clients.

On the Puppet master, if you have an existing plugins section in your fileserver.conf, get rid of the path parameter (if you leave the path parameter in place, then the mount will behave like any other fileserver mount). Move your existing plugins from the directory specified in that path into the modules for which they are relevant. If you do not have any modules defined or the types and facts are not relevant to any particular module you can create a generic module to hold all custom facts and types. It is recommended that you name this module custom.

Ruby libraries in your plugins directories behave like Ruby libraries in any other Ruby lib directory, and their paths need to match whatever Ruby would normally look for.

For example, Ruby expects Puppet resource types to be in $libdir/puppet/type/$type.rb, so for modules you would put them here:

<MODULEPATH>/<module>/plugins/puppet/type

For providers you place them in:

<MODULEPATH>/<module>/plugins/puppet/provider

Similarly, Facter facts belong in the facter subdirectory of the library directory:

<MODULEPATH>/<module>/plugins/facter

So, if we are using our custom module and our modulepath is /etc/puppet/modules then types and facts would be stored in the following directories:

/etc/puppet/modules/custom/plugins/puppet/type
/etc/puppet/modules/custom/plugins/puppet/provider
/etc/puppet/modules/custom/plugins/facter

Turn on pluginsync and specify factpath, so that the facts dropped by pluginsync are loaded by Puppet:

[main]
pluginsync = true
factpath = $vardir/lib/facter

'''WARNING:''' For versions earlier than 0.24.4 you may need to set the pluginsource and plugindest values. In 0.24.4 onwards you should remove these values as the defaults are now preferable. If you do need to set these values then try something like:

[main]
pluginsync=true
factsync=true
pluginsource = puppet://$server/plugins
plugindest = $vardir/lib
factpath = $vardir/lib/facter