Created attachment 143533 [details] Diff against the port. Patch to add interface alias support for the first 10 aliases (limited to 10 because I can't work out how to abort the loop when it gets to an alias that doesn't exist without writing a huge amount of code - which is more likely to break) Patch has been submitted to the developer, but no idea if they will accept it as it's only a FreeBSD thing.. all other OSs are supported for aliases. (probably would be a good idea to make it an optional patch - however I have left it as a default patch)
Output with patch: # facter | grep -E 'ip|alias' ipaddress => 174.36.235.173 ipaddress_em0 => 10.24.8.72 ipaddress_em1 => 174.36.235.173 ipaddress_em1_alias0 => 208.43.110.204 ipaddress_em1_alias1 => 208.43.110.205 ipaddress_em1_alias2 => 208.43.110.206 ipaddress_em1_alias3 => 208.43.110.207 ipaddress_lo0 => 127.0.0.1 netmask_em1_alias0 => 255.255.255.0 netmask_em1_alias1 => 255.255.255.0 netmask_em1_alias2 => 255.255.255.0 netmask_em1_alias3 => 255.255.255.0 Output currently (no patch): # facter | grep -E 'ip|alias' ipaddress => 174.36.235.173 ipaddress_em0 => 10.24.8.72 ipaddress_em1 => 174.36.235.173 ipaddress_lo0 => 127.0.0.1
Michele, could you open a pull request on GitHub to the facter project for that and discuss it with the Puppet Labs people? It's much better to upstream patches like this.
Already did, didn't get any reply, so make a port patch as well (FreeBSD is not very well supported with Puppet as it is) Michelle
Created attachment 144728 [details] Enhanced freebsd aliases for facter This is an enhanced version of the patch that adds a method to return aliases count and only iterates up to that number.
Pull request for my version: https://github.com/puppetlabs/facter/pull/731
We would be happy to pull in this patch into Facter itself, but we need a few things before we can merge the pull request. First off we need the CLA to be signed by all the contributors for the pull request. We have one on file for Daniel Siechniewicz but since Michelle Sullivan was the original author we will need Michelle to sign the CLA as well. Beyond that it would be nice to have some minor tweaks to the code in the pull request, but that'll be a straightforward matter of code review that I'm happy to help with as well. The main point is that we have to have a CLA on file for all contributors, and once we have that we can certainly get this change merged into upstream. Michelle, for the sake of my curiosity could you point out where you filed the original patch submission? It looks like your contribution may have slipped through the cracks and I would like to make sure this doesn't happen in the future.
I cannot for the life of me find record of where I filed it - but I am sure (as I do with all patches against things I find in Git) will have mailed the author (as recorded in GitHub) with a copy. What's a CLA? (Contributers License Agreement? If so point me at it so I can sign it... I should be in the bug system of PuppetLabs if this helps..) I am happy for this to go into Puppet/Facter with just passing remark of me and my email (yes my email! - I collect spam ;-) ... Michelle Sullivan <michelle@sorbs.net>
Yep, the CLA is the contributor's license agreement - IANAL but my best explanation is that it grants Puppet Labs a license to use your submission, and you retain copyright on your submission (if you're concerned about that). The CLA can be signed online at https://cla.puppetlabs.com/ by using your GitHub account. Once we have that from you we can merge this contribution in and I'll make sure you're credited in the commit log.
Done, thanks... use "Michelle Sullivan <michelle@sorbs.net>" where ever possible (don't hide/munge the email) - it's a great way of getting spammed. ;-)
Thanks much Michelle, and we'll make sure your email address is as spammable as possible! :)
I would be in favour of closing this. The patch never arrived in upstream facter 2.x and the recent facter 3.x series is written in C++. As this C++ implementation is missing quite some stuff for FreeBSD, I hope that somebody[tm] will implement the missing features in C++ and open PRs to the upstream Puppetlabs repo.
Closing, as this is no longer relevant.
No longer relevant? The patch didn't get put into the main stream, and as far as I can tell alias support on FreeBSD hasn't changed... But I'll be honest, I haven't looked all that close to current stuff either.