Foreman adding duplicate interfaces when using teaming

Problem:
We have the following issue. On boxes where we are using network teaming, foreman is adding a new duplicate interface on each puppet run. Eventually hosts end up with a great a mount of duplicate NIC records. This prevent us from editing the hosts until all these records are cleaned up

Expected outcome:

puppet should not add a new interface record on each puppet run

Foreman and Proxy versions:

foreman and proxy versions 1.15.3

Foreman and Proxy plugin versions:

Other relevant data:
We are using this in combination puppet 3.8.7

here is an example of the node.rb output for one of the affected boxes. It has a several duplicated eth0.105 interfaces. This same behavior is not seen if we use Bonding instead of Teaming.

foreman_interfaces:

  • ip:
    ip6:
    mac: ac:1f:6b:1e:25:20
    name:
    attrs:
    mtu: ‘1500’
    bridge: true
    virtual: true
    link: true
    identifier: br105
    managed: false
    primary: false
    provision: false
    subnet:
    subnet6:
    tag: ‘’
    attached_to: ‘’
    type: Bridge
    attached_devices: ‘’
  • ip:
    ip6:
    mac: ac:1f:6b:1e:25:20
    name:
    attrs:
    mtu: ‘1500’
    virtual: true
    link: true
    identifier: eth0.105
    managed: false
    primary: false
    provision: false
    subnet:
    subnet6:
    tag: ‘105’
    attached_to: eth0
    type: Interface
  • ip:
    ip6:
    mac: ac:1f:6b:1e:25:20
    name:
    attrs:
    mtu: ‘1500’
    virtual: true
    link: true
    identifier: eth0.105
    managed: false
    primary: false
    provision: false
    subnet:
    subnet6:
    tag: ‘105’
    attached_to: eth0
    type: Interface
  • ip:
    ip6:
    mac: ac:1f:6b:1e:25:20
    name:
    attrs:
    mtu: ‘1500’
    virtual: true
    link: true
    identifier: eth0.105
    managed: false
    primary: false
    provision: false
    subnet:
    subnet6:
    tag: ‘105’
    attached_to: eth0
    type: Interface
  • ip:
    ip6:
    mac: ac:1f:6b:1e:25:20
    name:
    attrs:
    mtu: ‘1500’
    virtual: true
    link: true
    identifier: eth0.105
    managed: false
    primary: false
    provision: false
    subnet:
    subnet6:
    tag: ‘105’
    attached_to: eth0
    type: Interface
  • ip:
    ip6:
    mac: ac:1f:6b:1e:25:20
    name:
    attrs:
    mtu: ‘1500’
    virtual: true
    link: true
    identifier: eth0.105
    managed: false
    primary: false
    provision: false
    subnet:
    subnet6:
    tag: ‘105’
    attached_to: eth0
    type: Interface
  • ip:
    ip6:
    mac: ac:1f:6b:1e:25:20
    name:
    attrs:
    mtu: ‘1500’
    virtual: true
    link: true
    identifier: eth0.105
    managed: false
    primary: false
    provision: false
    subnet:
    subnet6:
    tag: ‘105’
    attached_to: eth0
    type: Interface
  • ip:
    ip6:
    mac:
    name:
    attrs:
    firmware: ‘1.43’
    virtual: false
    link: true
    identifier: ipmi
    managed: false
    primary: false
    provision: false
    subnet:
    subnet6:
    tag:
    attached_to:
    type: BMC
    provider: IPMI
    username:
    password:
  • ip: 10.25.0.18
    ip6:
    mac: ac:1f:6b:1e:25:20
    name: s358.shared2.provo1.unifiedlayer.com
    attrs:
    network: 10.25.0.0
    netmask: 255.255.254.0
    mtu: ‘1500’
    virtual: false
    link: true
    identifier: team0
    managed: true
    primary: true
    provision: true
    subnet:
    name: uspro1_hg_private_mgmt
    network: 10.25.0.0
    mask: 255.255.254.0
    gateway: 10.25.0.1
    dns_primary: 10.212.4.17
    dns_secondary: ‘’
    from: 10.25.0.10
    to: 10.25.1.249
    boot_mode: Static
    ipam: DHCP
    vlanid: ‘106’
    network_type: IPv4
    subnet6:
    tag:
    attached_to:
    type: Interface
  • ip:
    ip6:
    mac: ac:1f:6b:1e:25:20
    name:
    attrs:
    mtu: ‘1500’
    virtual: true
    link: true
    identifier: team0.105
    managed: false
    primary: false
    provision: false
    subnet:
    subnet6:
    tag: ‘105’
    attached_to: team0
    type: Interface

You’re using old, unsupported version of Foreman. IIRC there’s a setting to ignore interfaces reported by puppet, so you can disable importing completely. Or there’s ignore interfaces matching some pattern setting that could help. If you can upgrade to 1.17, this post might be useful https://www.theforeman.org/2018/03/foreman-117-fact-filtering.html

Of course neither of this doesn’t solve the root cause. But I don’t think we’d fix that for 1.15 and puppet 3. Networking facts have changed in puppet 4+ a lot.

Can you gather “facter --json” over some time?

Can you then anonymize and pastebin at least two outputs?

If you do diff, do you see any changes? It looks like the identifier does not change. Then we can try to reproduce on last version.