When using the fact uploader script, it appears that bonded interfaces show up but without any information about which interfaces make up the bonded device. I am assuming because these are not by default part of facter’s canned facts?
I have tried manually adding the following fact names/values to a host’s fact file and re-running the script, but no luck either getting the bonded interface to show what devices are attached to it, or if a nic is part of a bond, which bond.
This is a limitation in facter. There is some logic to guess, but obviously this isn’t great.
Ideally we’d get this information from facter. Perhaps opening a ticket at https://tickets.puppetlabs.com/projects/FACT/issues would be a good start. Indicating the type (vlan/bond/bridge) in the networking facts would also be a great way to avoid guessing.
I’ll be at Puppet HQ for the Puppetize Live hackathon tomorrow and will be sure to bring it up. But that said, I can create custom facts, I am just wondering what the fact names need to be? I tried a couple already as I mentioned in my original post. I don’t imagine they should be part of the networking structured fact? That would require an update to facter, but from glancing at app/services/puppet_fact_parser.rb, it looks like foreman might just be considering the legacy facts like ipaddress_XXX mtu_XXX, etc.
That is correct. The problem with custom facts is that in Foreman core we essentially will standardize. If Facter itself starts to produce different facts, it may be incompatible which can be hell to support.
If we can come up with a spec of how it’ll be produced, implement that with custom facts and get facter to copy it (or at least not introduce it in an incompatible way) then I think we can modify the fact importer.
On a related note: our fact importer does need an update to support the modern facts. In https://github.com/theforeman/foreman/pull/7059 I’ve started with some preparations. I’d love to be ready for Facter 4 before it’s released and patches are very welcome.
cc @lzap we recently talked about this and how incredibly useful it would be.
Yeah, creating such a fact should be pretty straightforward as Linux exposes NIC parents/peers in the /sys/net structure. The only concern is that if that’s a custom fact, we don’t need to care about non-Linux system much, at least at the initial stage. If you want to push this into puppet, you need to think about non-Linux systems from the day one.
No unfortunately I got caught up with other topics, sorry! I am however currently asking about it on the Puppet community slack which most of the same people, including most Puppet employees participate on.