Using an external node classifier

When Puppet runs on a node, it needs to know which classes should be applied to that node. For example, if it is a web server node, it might need to include an apache class. The normal way to map nodes to classes is in the Puppet manifest itself, for example in a nodes.pp file:

node web1 {
  include apache
}

Alternatively, you can use an external node classifier to do this job. An external node classifier is any executable program that can accept a node name and return a list of classes for that node. It could be a simple shell script, for example, or a wrapper around a more complicated program or API that can decide how to map nodes to classes.

Getting ready…

  1. Set the following variables in your puppet.conf:
    [master] ...

Get Puppet 2.7 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.