Facter will display the values associated with network_* specific settings. Shouldn''t there be a way to display all connected (active) networks in one command? For example: # facter networks 192.168.1.2 10.0.1.1 10.10.23.0 I could then formulate a conditional based on the available networks. Of course, one could fairly argue that if I didn''t know what networks were available, then I should be using puppet to configure those anyway :-) My usage scenario includes this: For NFS we generally mount over a back-end, point-to-point network; however, there are times where some machines will only have the front-end network available and therefore we will just NFS-mount over that instead. I thought it might be useful to use a conditional for this that would *prefer* the back-end network, but use the front-end otherwise. 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.
windowsrefund
2011-Feb-10 22:00 UTC
[Puppet Users] Re: facter to display all active networks
On Feb 10, 3:59 pm, Forrie <for...@gmail.com> wrote:> Facter will display the values associated with network_* specific > settings. Shouldn''t there be a way to display all connected (active) > networks in one command? For example: > > # facter networks > 192.168.1.2 > 10.0.1.1 > 10.10.23.0 >Sounds like it would be simple enough to write a custom fact to do this. My approach would probably involve returning an array of existing facts that match ^network_ I''d probably want to take it a bit further though and return CIDR formatted networks by combining the returned value of each corresponding netmask_ fact. -- 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 could probably get away with using template or an inline template. On Feb 10, 5:00 pm, windowsrefund <windowsref...@gmail.com> wrote:> On Feb 10, 3:59 pm, Forrie <for...@gmail.com> wrote: > > > Facter will display the values associated with network_* specific > > settings. Shouldn''t there be a way to display all connected (active) > > networks in one command? For example: > > > # facter networks > > 192.168.1.2 > > 10.0.1.1 > > 10.10.23.0 > > Sounds like it would be simple enough to write a custom fact to do > this. My approach would probably involve returning an array of > existing facts that match ^network_ > > I''d probably want to take it a bit further though and return CIDR > formatted networks by combining the returned value of each > corresponding netmask_ fact.-- 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.
Daniel Pittman
2011-Feb-11 08:13 UTC
Re: [Puppet Users] facter to display all active networks
On Thu, Feb 10, 2011 at 12:59, Forrie <forrie@gmail.com> wrote:> Facter will display the values associated with network_* specific > settings. Shouldn''t there be a way to display all connected (active) > networks in one command? For example:FWIW, I would say the answer is best: not while facter only returns strings. This is rich data, and something that stringifies it will introduce pain that we need to support for a long, long time. Regards, Daniel -- ⎋ Puppet Labs Developer – http://puppetlabs.com ✉ Daniel Pittman <daniel@puppetlabs.com> ✆ Contact me via gtalk, email, or phone: +1 (877) 575-9775 ♲ Made with 100 percent post-consumer electrons -- 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.