need help with nmcli module and bridge-slave

Hi,

I need some help with nmcli and bridge-slave. I’m running the script from fedora 28, and trying to setup a centos 7 (minimal install iso) kvm node.

`

  • set_fact:
    bridge_slave: “{{ ansible_interfaces | difference([‘lo’,‘br0’]) | first }}”

  • name: setup bridge
    nmcli:
    type: bridge
    conn_name: br0
    state: present

  • name: setup bridge slave
    nmcli:
    type: bridge-slave
    conn_name: “{{ bridge_slave }}”
    state: present
    master: br0
    `

results in

fatal: [host]: FAILED! => {“changed”: false, “msg”: “Error: invalid or not allowed setting ‘bridge-port’: ‘bridge-port’ not among [connection, 802-3-ethernet (ethernet), 802-1x, dcb, ipv4, ipv6, tc, proxy].\n”, “name”: “enp0s31f6”, “rc”: 2}

The docs are lacking for bridge-slave, and I’m probably missing something. Any ideas?

Relevant lines of code in nmcli.py:

https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/net_tools/nmcli.py#L1000

`

options = {
‘master’: self.master,
‘bridge-port.path-cost’: self.path_cost,
‘bridge-port.hairpin’: self.bool_to_string(self.hairpin),
‘bridge-port.priority’: self.slavepriority,
}

`

Best wishes,
Greg

Hi,

I need some help with nmcli and bridge-slave. I’m running the script from fedora 28, and trying to setup a centos 7 (minimal install iso) kvm node.

`

  • set_fact:
    bridge_slave: “{{ ansible_interfaces | difference([‘lo’,‘br0’]) | first }}”

  • name: setup bridge
    nmcli:
    type: bridge
    conn_name: br0
    state: present

  • name: setup bridge slave
    nmcli:
    type: bridge-slave
    conn_name: “{{ bridge_slave }}”
    state: present
    master: br0
    `

results in

fatal: [host]: FAILED! => {“changed”: false, “msg”: “Error: invalid or not allowed setting ‘bridge-port’: ‘bridge-port’ not among [connection, 802-3-ethernet (ethernet), 802-1x, dcb, ipv4, ipv6, tc, proxy].\n”, “name”: “enp0s31f6”, “rc”: 2}

The docs are lacking for bridge-slave, and I’m probably missing something. Any ideas?

Relevant lines of code in nmcli.py:

https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/net_tools/nmcli.py#L1000

`

options = {
‘master’: self.master,
‘bridge-port.path-cost’: self.path_cost,
‘bridge-port.hairpin’: self.bool_to_string(self.hairpin),
‘bridge-port.priority’: self.slavepriority,
}

`

Yes, commenting out the 3 ‘bridge-port’ lines works. I’ll open a bug.

`
$ ip a
1: lo
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000
link/ether
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether
inet 192.168.1.11/24 brd 192.168.1.255 scope global noprefixroute dynamic br0
valid_lft 86268sec preferred_lft 86268sec
inet6 scope link noprefixroute
valid_lft forever preferred_lft forever

`

Hi,

I need some help with nmcli and bridge-slave. I’m running the script from fedora 28, and trying to setup a centos 7 (minimal install iso) kvm node.

`

  • set_fact:
    bridge_slave: “{{ ansible_interfaces | difference([‘lo’,‘br0’]) | first }}”

  • name: setup bridge
    nmcli:
    type: bridge
    conn_name: br0
    state: present

  • name: setup bridge slave
    nmcli:
    type: bridge-slave
    conn_name: “{{ bridge_slave }}”
    state: present
    master: br0
    `

results in

fatal: [host]: FAILED! => {“changed”: false, “msg”: “Error: invalid or not allowed setting ‘bridge-port’: ‘bridge-port’ not among [connection, 802-3-ethernet (ethernet), 802-1x, dcb, ipv4, ipv6, tc, proxy].\n”, “name”: “enp0s31f6”, “rc”: 2}

The docs are lacking for bridge-slave, and I’m probably missing something. Any ideas?

Relevant lines of code in nmcli.py:

https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/net_tools/nmcli.py#L1000

`

options = {
‘master’: self.master,
‘bridge-port.path-cost’: self.path_cost,
‘bridge-port.hairpin’: self.bool_to_string(self.hairpin),
‘bridge-port.priority’: self.slavepriority,
}

`

Yes, commenting out the 3 ‘bridge-port’ lines works. I’ll open a bug.

https://github.com/ansible/ansible/issues/42460