Use netgroups as classes

150 views
Skip to first unread message

Nikhil Mulley

unread,
Mar 19, 2012, 4:05:47 AM3/19/12
to puppet...@googlegroups.com
Hi,

In my puppet configuration, to deploy certain files to group of nodes, everytime either a new class of node is being used or the node class has to typically extended to many other machines and is likely more typing. The more typing can generally result in anomalies/errors in hosts.

For example:

node x1.y.z x2.y.z x3.y.z x4.y.z{
...
...
}

What I am trying to formulate this into is use the netgroup information available from /etc/netgroup and get this grouped as

node @xN-y-z-hosts {
...
...
}

or


nodegroup @xN-y-z-hosts {
...
...
}

What are the things that would possibly require the changes to?

Thanks,
Nikhil

Russell Van Tassell

unread,
Mar 19, 2012, 4:22:04 AM3/19/12
to puppet...@googlegroups.com
It's a bit of a change, but you're probably best just looking at ENCs (External Node Classifiers)...


As with anything else, there's a half dozen (if not more) ways to do it. Some of the "gotchas" include making the ENC a single point of failure. It is probably best (?) to generate a simple node classification file on the server, then push that out to the clients. The clients can either pick it up by a simple YAML file, or through another equally simple script.

Hope that helps get you started in the right direction...






--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/oB1zl_KR2MoJ.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

jcbollinger

unread,
Mar 19, 2012, 9:23:15 AM3/19/12
to Puppet Users


On Mar 19, 3:05 am, Nikhil Mulley <mnik...@gmail.com> wrote:
> Hi,
>
> In my puppet configuration, to deploy certain files to group of nodes,
> everytime either a new class of node is being used or the node class has to
> typically extended to many other machines and is likely more typing. The
> more typing can generally result in anomalies/errors in hosts.
>
> For example:
>
> node x1.y.z x2.y.z x3.y.z x4.y.z{
> ...
> ...
>
> }
>
> What I am trying to formulate this into is use the netgroup information
> available from /etc/netgroup and get this grouped as [...]


That's backwards. The contents of /etc/netgroup should be managed by
Puppet if you rely on it for anything. If it already is managed then
Puppet already has the information you want, though you probably need
to refactor. If /etc/netgroup is *not* already managed by Puppet then
it's a poor idea to set it up as a supplemental source of truth.

An ENC would provide what you need, though whether it would be any
better in practice depends on how it's implemented. You might find
that a simple script would suit you, or else that hiera's ENC features
do everything you need.

Your description of the problem is rather abstract, however. If you
want more specific advice then it would help to provide a little more
detail about how your node definitions are set up, and an example or
two of the kind of error-prone operation you want to avoid.


John

flex

unread,
Mar 19, 2012, 4:15:02 AM3/19/12
to puppet...@googlegroups.com
you can use external nodes to do that, see http://docs.puppetlabs.com/guides/external_nodes.html
just using a script to generate the nodes' info.


--
Reply all
Reply to author
Forward
0 new messages