# nxos\_portchannel not creating port channel

**URL:** <https://forum.ansible.com/t/nxos-portchannel-not-creating-port-channel/23017>\
**Category:** Ansible Project\
**Created:** [November 14, 2016, 12:55pm UTC](https://forum.ansible.com/t/nxos-portchannel-not-creating-port-channel/23017 "2016-11-14T12:55:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scarter](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@scarter](https://forum.ansible.com/u/scarter)\
**Post date:** [November 14, 2016, 12:55pm UTC](https://forum.ansible.com/t/nxos-portchannel-not-creating-port-channel/23017/1 "2016-11-14T12:55:21Z")

</div>

I have the following module invocation:

- name: Create port-channels on the ToR(s)  
nxos\_portchannel:  
host: “{{ item.switch }}”  
transport: cli  
group: “{{ item.interface | regex\_replace(‘\[1\]+([0-9]+)$’, ‘\1’) }}”  
members: “{{ item.port\_list }}”  
mode: “{{ item.mode | default(‘active’) }}”  
state: present  
force: true  
with\_items: “{{ port\_data | default() }}”  
when: item.port\_list is defined  
register: command\_result

When I run the playbook, it thinks the port-channel is already there:

TASK [Create port-channels on the ToR(s)] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost] =\> (item={u’switch’: u’[csn-sjc18-n9k3.ciscolabs.net](http://csn-sjc18-n9k3.ciscolabs.net)’, u’port\_list’: [u’Eth1/32’], u’vpc’: 32, u’interface’: u’Port-channel32’, u’port\_profile’: u’rhev-host’, u’desc’: u’rhev1.rhat’})

But it is not:

csn-sjc18-n9k3# show port-channel summary  
1 Po1(SU) Eth NONE Eth2/12(P)  
2 Po2(SU) Eth LACP Eth2/1(P)  
3 Po3(SU) Eth LACP Eth1/1(P) Eth1/2(P)  
4 Po4(SU) Eth LACP Eth1/3(P) Eth1/4(P)  
5 Po5(SU) Eth LACP Eth1/5(P)  
6 Po6(SU) Eth LACP Eth1/6(P)  
7 Po7(SU) Eth LACP Eth1/7(P)  
300 Po300(SU) Eth NONE Eth1/45(P) Eth1/46(P)

The results has a “proposed” section, but no “updates” sections. Does that mean Ansible thinks it needs to make a change, but doesn’t actually make it?

“results”: [  
{  
“\_ansible\_item\_result”: true,  
“\_ansible\_no\_log”: false,  
“\_ansible\_parsed”: true,  
“changed”: false,  
“end\_state”: {},  
“existing”: {},  
“invocation”: {  
“module\_args”: {  
“auth\_pass”: null,  
“authorize”: false,  
“config”: null,  
“force”: “true”,  
“group”: “32”,  
“host”: “[csn-sjc18-n9k3.ciscolabs.net](http://csn-sjc18-n9k3.ciscolabs.net)”,  
“include\_defaults”: “False”,  
“members”: [  
“Eth1/32”  
],  
“min\_links”: null,  
“mode”: “active”,  
“password”: null,  
“port”: null,  
“provider”: null,  
“save”: false,  
“ssh\_keyfile”: null,  
“state”: “present”,  
“timeout”: 10,  
“transport”: “cli”,  
“use\_ssl”: false,  
“username”: null,  
“validate\_certs”: true  
},  
“module\_name”: “nxos\_portchannel”  
},  
“item”: {  
“desc”: “rhev1.rhat”,  
“interface”: “Port-channel32”,  
“port\_list”: [  
“Eth1/32”  
],  
“port\_profile”: “rhev-host”,  
“switch”: “[csn-sjc18-n9k3.ciscolabs.net](http://csn-sjc18-n9k3.ciscolabs.net)”,  
“vpc”: 32  
},  
“proposed”: {  
“group”: “32”,  
“members”: [  
“Eth1/32”  
],  
“mode”: “active”  
},  
“updates”:   
},

Thanks,

Steven.

* * *

1. ^0-9
