On Jun 16, 2010, at 8:32 PM, Daniel Pittman wrote:

> Cody Herriges <[email protected]> writes:
> 
>> My preliminary work on a new fact that reports IPv6 addresses.
> 
> It looks like this reports *an* IPv6 address, not multiple IPv6 addresses,
> even though every adapter / host has at least one, and ofter multiple, these
> days.  You should report all the addresses, link-local included, I would
> suggest.  That obviously applies to all the implementations. :)

Isn't this the job more of something like lib/facter/util/ip.rb.  Dynamically 
generating the facts based on how many addresses are associated with an 
interface would remove the ability to run `facter ipaddress6` and get anything 
returned.  Patching ip.rb is on my list of things todo so that multiple 
interface and address facts are/will be generated. 

> 
>> +Facter.add(:ipaddress6) do
>> +    confine :kernel => :linux
>> +    setcode do
>> +        ip = nil
>> +        output = %x{/sbin/ifconfig}
> 
> This would enormously better use /sbin/ip from iproute2, if available, since
> that can report addresses that are simply invisible to /sbin/ifconfig.  This
> includes secondary addresses assigned to the same adapter without an alias
> name, and causes issues with IPv4 as well.

I would say that a machine's primary IP address will be visible by ifconfig and 
the ipaddress/ipaddress6 facts have always assumed that the machine's primary 
ipaddress resides on the lowest numbered interface, often eth0.  I know this 
doesn't hold true beyond Linux as traditional unixes name interfaces by driver. 
The ip.rb util could likely benefit from the conversion from `ifconfig` to `ip` 
and I will look at this when I start looking at patching ip.rb.

I am far from done thinking through and patching all the pieces of this but it 
was requested on the ticket tracker to ship off what I had started and my 
thoughts to the dev list before I moved much further.

--Cody

Attachment: PGP.sig
Description: This is a digitally signed message part

Reply via email to