Casey Feskens
2010-May-05 18:38 UTC
[Puppet Users] determine whether host responds to an IP address
Hey folks, I''m looking for a best practice for determining whether a host has a specific IP address configured on it, in order to make puppet configuration decisions. I know there are a list of facts for each interface with an associated IP address, but am trying to determine whether ANY interface matches a corresponding IP. I haven''t found a good way to cleanly iterate through multiple facts. Does anyone have a good way for doing this? Should I be using a custom type? Thanks, Casey -- --------------------------------------------- Casey Feskens<cfeskens@willamette.edu> System Administrator/Network Svcs. Consultant Willamette Integrated Technology Services Willamette University, Salem, OR --------------------------------------------- -- 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.
Michael DeHaan
2010-May-06 15:31 UTC
Re: [Puppet Users] determine whether host responds to an IP address
On Wed, May 5, 2010 at 2:38 PM, Casey Feskens <cfeskens@willamette.edu> wrote:> Hey folks, > > I''m looking for a best practice for determining whether a host has a > specific IP address configured on it, in order to make puppet configuration > decisions. I know there are a list of facts for each interface with an > associated IP address, but am trying to determine whether ANY interface > matches a corresponding IP. I haven''t found a good way to cleanly iterate > through multiple facts. Does anyone have a good way for doing this? Should > I be using a custom type? > > Thanks, > CaseyI''m inclined to say you''re going to need something like that, but probably a custom /function/, rather than a custom type. That way you could ideally do things like: if has_ip(''192.168.5.5'') { ... } Though I''m a bit curious as to what kind of configuration decisions you''re making, as it would be ideal if a manifest didn''t key off that, but rather on the types of classes assigned to it. A class that behaves differently if installed on a different server seems to imply an inherited class would be useful. --Michael> > -- > --------------------------------------------- > Casey Feskens<cfeskens@willamette.edu> > System Administrator/Network Svcs. Consultant > Willamette Integrated Technology Services > Willamette University, Salem, OR > --------------------------------------------- > > -- > 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. > >-- 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.