Tuesday, 9 April 2013
Using an External Node Classifier in a masterless configuration with Puppet
I use standalone puppet a lot for managing my own machines and cloud servers, but the site.pp file was starting to grow large and it became obvious the solution was to use an external node classifier or ENC.
There is lots of documentation on the web on how to do this with a puppet master/ agent configuration, but nothing I could find on how to do this.
The key change is where you specify the change of node class information in the puppet.conf file. If you follow the puppetlabs documents , it won't work. If however you put the new ENC definition into the [main] section , it works just fine. Only a minor change , but it will not work unless you do.
The code you need looks like this:
node_terminus = exec
external_nodes = /usr/local/bin/node_classifier.py
The node classifier can be whatever you want, but I used python just to get it up and running quickly for testing.
I hope this saves someone hours of hunting around to get this sorted.
During my research , I have also found that it should be possible in the latest releases to use Hiera as your ENC to generate the YAML required. Next on my list to try.
Link to Puppet Labs ENC documentation
Using Hiera as your ENC
Labels:
amazon,
automation,
cloud,
devops,
linux.redhat,
puppet,
puppetlabs
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment