On Tuesday, December 3, 2013 5:50:47 PM UTC-6, Stuart Cracraft wrote: > > Hi, > > I'd like to use ENC:: > > http://docs.puppetlabs.com/guides/external_nodes.html > > to keep hardwired customizations away from our classes and other files as > much as possible > particularly for the node name, but potentially as esoteric as a machine > configuration, file > permission, service name, etc - to keep the classes as flexible and > general as possible. > > My questions: > > + have you done the above? >
I'd like to think that I write flexible, general classes. That's pretty much orthogonal to use of an ENC, however, and in fact I do not use an ENC. You are quite right, however, that a big part of making your classes flexible and general is to keep data out of classes -- that is, to externalize your data. > + what were your learnings > + do you have sample puppet_node_classifier's you can share? > + how to use the definitions from ENC via the pm's puppet.conf's linkage > to the ENC > I don't think I understand the question. Your puppet.conf specifies the ENC to use. Each time a node requests a catalog from the master, it runs the specified ENC program, passing the node's identifier as an argument. The master parses the ENC's YAML output to obtain global variable settings and the names of classes that should be declared for the given node, optionally with associated maps of class parameter values. These may be supplemented by node declarations appearing in your manifests. You don't actively "use" definitions from an ENC; rather, the master automatically incorporates the ENC output as a source of declarations about the target node. ENCs are a non-exclusive alternative to node declarations. If what you are looking for is simply a way to externalize data used by your classes, then hiera is Puppet's built-in facility supporting that. Open-source Puppet does not provide a GUI for hiera configuration or hiera data manipulation (I don't know about PE), but the general thrust of your questions leads me to suspect that that may not be important to you. Hiera supports automatic binding of data to class parameters, but its classic usage mode is via a lookup function in your manifest code: $my_special_datum = hiera('special') . Thus, you can draw data from hiera without using parameterized classes or in addition to via automated class parameter binding, if you should wish to do so. > > [main] > : > node_terminus = exec > external_nodes = /usr/local/bin/puppet_node_classifier > : > > My current question is how do you use the ENC definitions within the > classes? > > Is this adequately described in-depth in the yet-to-be-published Puppet > book? > > I can't speak to the content of any unpublished book, but I think the PL docs cover the matter pretty well already: http://docs.puppetlabs.com/guides/external_nodes.html. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/0a909355-1436-4a66-91ae-5c0f755268ad%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.