instead of using hostname wildcard, is there a way to define nodes by their IP addresses? for example, I want to put all nodes with 10.0.2.x and 10.0.3.0 to a nodes group called "testing". how can I do this? thanks. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Steph Gosling
2012-Jul-05 18:40 UTC
Re: [Puppet Users] can nodes be grouped with IP address?
Hi, On Thu, 5 Jul 2012 11:34:39 -0700 Hai Tao <ehaitao@gmail.com> wrote:> instead of using hostname wildcard, is there a way to define nodes by their > IP addresses? for example, I want to put all nodes with 10.0.2.x and > 10.0.3.0 to a nodes group called "testing". how can I do this? > > thanks.Seems a bit backwards to me (you''re the ones assigning the IP addresses afterall) but I don''t see why you couldn''t do this with a custom fact and a class that reads it. Cheers, Steph -- Steph Gosling <steph@chuci.org> -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Ryan Bowlby
2012-Jul-09 08:08 UTC
[Puppet Users] Re: can nodes be grouped with IP address?
I would probably grimace and find my right eye twitch ramp back up if this was in my environment....but here you go: node default { if $::ipaddress =~ /^10\.0\.[3,4]\.\d{1,3}$/ { include testing # testing class } } Obviously make sure no other matching node defs exist for this host. -Ryan On Thursday, July 5, 2012 11:34:39 AM UTC-7, Hai wrote:> > instead of using hostname wildcard, is there a way to define nodes by > their IP addresses? for example, I want to put all nodes with 10.0.2.x and > 10.0.3.0 to a nodes group called "testing". how can I do this? > > thanks. >-- 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/-/KGRDXRuwnZ4J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.