# need help with nmcli module and bridge-slave

**URL:** <https://forum.ansible.com/t/need-help-with-nmcli-module-and-bridge-slave/27982>\
**Category:** Ansible Developer\
**Tags:** fedora\
**Created:** [July 7, 2018, 2:45pm UTC](https://forum.ansible.com/t/need-help-with-nmcli-module-and-bridge-slave/27982 "2018-07-07T14:45:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg\_Sheremeta](https://avatars.discourse-cdn.com/v4/letter/g/ecccb3/32.png) [@Greg\_Sheremeta](https://forum.ansible.com/u/Greg_Sheremeta)\
**Post date:** [July 7, 2018, 2:45pm UTC](https://forum.ansible.com/t/need-help-with-nmcli-module-and-bridge-slave/27982/1 "2018-07-07T14:45:25Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![Greg\_Sheremeta](https://avatars.discourse-cdn.com/v4/letter/g/ecccb3/32.png) [@Greg\_Sheremeta](https://forum.ansible.com/u/Greg_Sheremeta)\
**Post date:** [July 7, 2018, 2:54pm UTC](https://forum.ansible.com/t/need-help-with-nmcli-module-and-bridge-slave/27982/2 "2018-07-07T14:54:41Z")

</div>

> 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](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

`

---

<div class="post-metadata">

**Author:** ![Greg\_Sheremeta](https://avatars.discourse-cdn.com/v4/letter/g/ecccb3/32.png) [@Greg\_Sheremeta](https://forum.ansible.com/u/Greg_Sheremeta)\
**Post date:** [July 7, 2018, 3:03pm UTC](https://forum.ansible.com/t/need-help-with-nmcli-module-and-bridge-slave/27982/3 "2018-07-07T15:03:56Z")

</div>

> > 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](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](https://github.com/ansible/ansible/issues/42460)
