On Sep 26, 2013, at 8:37 AM, Bret Wortman <[email protected]> wrote:

> Is there a way to set up my system so that I can do something like this in my 
> site.pp file:
> 
> import 'nodes/*.pp'
> import 'node-groups/*.pp'
> 
> What I'm looking for is a way to have a node-groups/webserver.pp file which 
> specifies the default configuration for a web server. Then, if I have a 
> one-off web server which requires a different configuration, I can drop it 
> into nodes/web1.pp and have that manifest be the one which is used for the 
> named host
> 
> Within the node-groups/*.pp files, nodes are specified using regexes. Within 
> the nodes/*.pp files, they'd be specified using exact strings.
> 
> I'm doing this now, but have discovered that quite often, the group manifest 
> gets used in preference to the individual manifest. How can I reverse this 
> behavior? Is it even possible?
> 
> 
> Bret Wortman

If your regex-matched node definition is being applied in preference to an 
fqdn-matched node definition, then something isn't right. Puppet is supposed to 
apply the most specific node definition. For example, if your fqdn is 
"web12.domain.org", then this declaration

    node 'web12.domain.org' { include specific_class }

should always be applied instead of this

    node /^web\d+.*/ { include general_class }

Take a look at the Matching section on this page to see how decides which node 
definition to use when more than one can apply:

http://docs.puppetlabs.com/puppet/2.7/reference/lang_node_definitions.html#matching

--
Peter

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to