bond: attach ports when creating the bonding connection

When ports are not attached, the bonding connection may risk not in fully
connected state, e.g. connecting (getting IP configuration). Therefore,
attach ports for the bonding connection.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
This commit is contained in:
Wen Liang 2022-10-07 09:22:09 -04:00 committed by Fernando Fernández Mancera
parent d311d60b73
commit 5c9456a8a3

View file

@ -126,6 +126,18 @@
arp_ip_target: 192.0.2.128
arp_validate: none
primary: "{{ dhcp_interface1 }}"
# add an ethernet to the bond
- name: "{{ port1_profile }}"
state: up
type: ethernet
interface_name: "{{ dhcp_interface1 }}"
controller: "{{ controller_profile }}"
# add a second ethernet to the bond
- name: "{{ port2_profile }}"
state: up
type: ethernet
interface_name: "{{ dhcp_interface2 }}"
controller: "{{ controller_profile }}"
- command: cat
/sys/class/net/{{ controller_device }}/bonding/'{{ item.key }}'
name: "** TEST check bond settings"