Christopher Johnston
2010-Oct-04 21:35 UTC
[Puppet Users] Facter ignores interfaces with non eth names
Does facter support NICs that are not named ethX? I happen to use custom names on my systems. Just a quick look at the code I don''t see why it wouldn''t but the behavior I am seeing is very different. -- 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.
Gary Law
2010-Oct-04 21:50 UTC
Re: [Puppet Users] Facter ignores interfaces with non eth names
On 4 October 2010 22:35, Christopher Johnston <chjohnst@gmail.com> wrote:> Does facter support NICs that are not named ethX? I happen to use custom > names on my systems. Just a quick look at the code I don''t see why it > wouldn''t but the behavior I am seeing is very different.works for me: glaw@sv01:~ $ facter | grep e1000g interfaces => lo0_13,e1000g0_13 ipaddress_e1000g0_13 => x.x.x.x netmask_e1000g0_13 => x.x.x.x network_e1000g0_13 => x.x.x.x YMMV -- Gary Law Email: garylaw@garylaw.net Chat googletalk/messenger: gary.law@gmail.com iChat/jabber/AIM: gary.law@mac.com -- 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.
Christopher Johnston
2010-Oct-04 22:21 UTC
Re: [Puppet Users] Facter ignores interfaces with non eth names
I am using 1.58, I see the issue though. I have interfaces called wan and lan without a \d+ at the end. Looks they are getting skipped. I will play with the regex to see whats up. On Mon, Oct 4, 2010 at 5:50 PM, Gary Law <garylaw@garylaw.net> wrote:> On 4 October 2010 22:35, Christopher Johnston <chjohnst@gmail.com> wrote: > > Does facter support NICs that are not named ethX? I happen to use custom > > names on my systems. Just a quick look at the code I don''t see why it > > wouldn''t but the behavior I am seeing is very different. > > works for me: > > glaw@sv01:~ $ facter | grep e1000g > interfaces => lo0_13,e1000g0_13 > ipaddress_e1000g0_13 => x.x.x.x > netmask_e1000g0_13 => x.x.x.x > network_e1000g0_13 => x.x.x.x > > YMMV > > > -- > Gary Law > Email: garylaw@garylaw.net > Chat googletalk/messenger: gary.law@gmail.com > iChat/jabber/AIM: gary.law@mac.com > > -- > 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<puppet-users%2Bunsubscribe@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.
Paul Nasrat
2010-Oct-04 23:11 UTC
Re: [Puppet Users] Facter ignores interfaces with non eth names
On 4 October 2010 15:21, Christopher Johnston <chjohnst@gmail.com> wrote:> I am using 1.58, I see the issue though. I have interfaces called wan and > lan without a \d+ at the end. Looks they are getting skipped. I will play > with the regex to see whats up.The whole way this works is going to be revisited for 2.x. Paul -- 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.
Joe McDonagh
2010-Oct-05 13:31 UTC
Re: [Puppet Users] Facter ignores interfaces with non eth names
On 10/04/2010 05:35 PM, Christopher Johnston wrote:> Does facter support NICs that are not named ethX? I happen to use > custom names on my systems. Just a quick look at the code I don''t see > why it wouldn''t but the behavior I am seeing is very different. -- > 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.On OpenBSD NIC devices are named based on the driver they use, and in some cases the meta-type of the NIC (trunkX, carpX). Those all show up in facter on those machines. -- Joe McDonagh AIM: YoosingYoonickz IRC: joe-mac on freenode "When the going gets weird, the weird turn pro." -- 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.
Christopher Johnston
2010-Oct-05 13:37 UTC
Re: [Puppet Users] Facter ignores interfaces with non eth names
Yes, but by X you mean they are represented with a digit? I have systems that do not have interfaces represented with the name and then a digit (WAN, LAN, BACKUP, etc). The regex looks to not pick those interfaces up. On Tue, Oct 5, 2010 at 9:31 AM, Joe McDonagh <joseph.e.mcdonagh@gmail.com>wrote:> On 10/04/2010 05:35 PM, Christopher Johnston wrote: > >> Does facter support NICs that are not named ethX? I happen to use custom >> names on my systems. Just a quick look at the code I don''t see why it >> wouldn''t but the behavior I am seeing is very different. -- >> >> 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<puppet-users%2Bunsubscribe@googlegroups.com> >> . >> For more options, visit this group at >> http://groups.google.com/group/puppet-users?hl=en. >> > On OpenBSD NIC devices are named based on the driver they use, and in some > cases the meta-type of the NIC (trunkX, carpX). Those all show up in facter > on those machines. > > -- > Joe McDonagh > AIM: YoosingYoonickz > IRC: joe-mac on freenode > "When the going gets weird, the weird turn pro." > > > -- > 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<puppet-users%2Bunsubscribe@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.
Christopher Johnston
2010-Oct-05 17:12 UTC
Re: [Puppet Users] Facter ignores interfaces with non eth names
I got this working by modifying the regex which seems to be explicit for a
specific output, but in reality it could be simpler - unless I am missing
something. This change works for me now and I tested various interface
names (eth0, eth0.100, bond0, eth, WAN, LAN). Thoughts?
$ git diff ip.rb
diff --git a/lib/facter/util/ip.rb b/lib/facter/util/ip.rb
index 366303c..32d943e 100644
--- a/lib/facter/util/ip.rb
+++ b/lib/facter/util/ip.rb
@@ -56,7 +56,7 @@ module Facter::Util::IP
# at the end of interfaces. So, we have to trim those trailing
# characters. I tried making the regex better but supporting all
# platforms with a single regex is probably a bit too much.
- output.scan(/^[-\w]+[.:]?\d+[.:]?\d*[.:]?\w*/).collect { |i|
i.sub(/:$/, '''') }.uniq
+ output.scan(/^[-\w]\S*/).collect { |i| i.sub(//, '''')
}.uniq
end
def self.get_all_interface_output
On Tue, Oct 5, 2010 at 9:37 AM, Christopher Johnston
<chjohnst@gmail.com>wrote:
> Yes, but by X you mean they are represented with a digit? I have systems
> that do not have interfaces represented with the name and then a digit
(WAN,
> LAN, BACKUP, etc). The regex looks to not pick those interfaces up.
>
>
> On Tue, Oct 5, 2010 at 9:31 AM, Joe McDonagh
<joseph.e.mcdonagh@gmail.com>wrote:
>
>> On 10/04/2010 05:35 PM, Christopher Johnston wrote:
>>
>>> Does facter support NICs that are not named ethX? I happen to use
custom
>>> names on my systems. Just a quick look at the code I
don''t see why it
>>> wouldn''t but the behavior I am seeing is very different.
--
>>>
>>> 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<puppet-users%2Bunsubscribe@googlegroups.com>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/puppet-users?hl=en.
>>>
>> On OpenBSD NIC devices are named based on the driver they use, and in
some
>> cases the meta-type of the NIC (trunkX, carpX). Those all show up in
facter
>> on those machines.
>>
>> --
>> Joe McDonagh
>> AIM: YoosingYoonickz
>> IRC: joe-mac on freenode
>> "When the going gets weird, the weird turn pro."
>>
>>
>> --
>> 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<puppet-users%2Bunsubscribe@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.