Add slaves to bond master interface after it's set up
Add slaves to bond master interface after it's set up

Problem description:
--------------------

On Ubuntu, state 'network.managed' doesn't add slaves
to bonding master interface after it is UP

Example pillars:

linux_interface_bond0:
  network.managed:
  - enabled: True
  - name: bond0
  - type: bond
  - mode: active-backup
  - slaves: enp8s0f1
  - require:
    - network: linux_interface_enp8s0f1

linux_interface_enp8s0f1:
  network.managed:
  - enabled: True
  - name: enp8s0f1
  - type: slave
  - master: bond0

Example result:

3: enp8s0f1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 0c:c4:7a:a8:d0:37 brd ff:ff:ff:ff:ff:ff
42: bond0: <NO-CARRIER,BROADCAST,MULTICAST,MASTER,UP> mtu 9000 qdisc noqueue master ovs-system state DOWN mode DEFAULT group default qlen 1000
    link/ether ee:ae:74:0d:17:29 brd ff:ff:ff:ff:ff:ff

...
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: None
...

Workarounds:
------------

For Ubuntu, it is suggested to restart 'networking' service
to make changes take effect.
Another common workaround is to reboot the machine.

These workarounds are not suitable in some cases, when only non-primary
interfaces are added to bonding interface, so the connectivity to
the salt minion is not broken during state execution.

Proposed solution:
------------------

Let's use 'ifenslave' tool to add slave interfaces to the bonding
interface right after the bonding interface is created/restarted.

saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt