Wrong ip address published in foreman

Hello,

We have a few hosts with a rather complex interface configuration. Facter
shows this:

ipaddress => 10.0.1.17
ipaddress_br100 => 10.0.1.17
ipaddress_br200 => 10.1.1.17
ipaddress_br300 => 10.2.1.17
ipaddress_br400 => 10.3.1.17
ipaddress_br550 => 10.10.1.17
ipaddress_lo => 127.0.0.1

The reasoning for all the bridges is to be able to plug virtual machines in
to VLANs.

The problem is that the "main" IP of this host is 10.1.1.17, and this is
also the subnet that is declared on it. For some reason however the
ipaddress fact, which gets pushed back in to foreman is set to 10.0.1.17,
and this causes problems. How can I make sure that the ipaddress fact is
set to the IP of the br200 interface?

Krist

This comes from the "ipaddress" fact, from Facter.

You can either disable updating of IP and MAC information from facts by
setting "ignore_puppet_facts_for_provisioning" to true under Adminster >
Settings, or try to fix the fact.

The ipaddress fact is rather unreliable, as it tends to pick the first
network interface rather than what you might consider to be the default.

You could probably use external or custom facts to override the value
with your own logic:
https://docs.puppetlabs.com/facter/latest/custom_facts.html#external-facts

··· On 21/10/14 08:27, Krist van Besien wrote: > Hello, > > We have a few hosts with a rather complex interface configuration. > Facter shows this: > > > > ipaddress => 10.0.1.17 > ipaddress_br100 => 10.0.1.17 > ipaddress_br200 => 10.1.1.17 > ipaddress_br300 => 10.2.1.17 > ipaddress_br400 => 10.3.1.17 > ipaddress_br550 => 10.10.1.17 > ipaddress_lo => 127.0.0.1 > > The reasoning for all the bridges is to be able to plug virtual machines > in to VLANs. > > The problem is that the "main" IP of this host is 10.1.1.17, and this is > also the subnet that is declared on it. For some reason however the > ipaddress fact, which gets pushed back in to foreman is set to > 10.0.1.17, and this causes problems. How can I make sure that the > ipaddress fact is set to the IP of the br200 interface?


Dominic Cleal
Red Hat Engineering