# nxos\_interface crashes when interface Vlan is specified

**URL:** <https://forum.ansible.com/t/nxos-interface-crashes-when-interface-vlan-is-specified/24290>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [April 22, 2017, 11:38am UTC](https://forum.ansible.com/t/nxos-interface-crashes-when-interface-vlan-is-specified/24290 "2017-04-22T11:38:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Petr\_Hruby](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@Petr\_Hruby](https://forum.ansible.com/u/Petr_Hruby)\
**Post date:** [April 22, 2017, 11:38am UTC](https://forum.ansible.com/t/nxos-interface-crashes-when-interface-vlan-is-specified/24290/1 "2017-04-22T11:38:05Z")

</div>

Hello all,

I’ve just started to play with Ansible.When I run playbook which should create int Vlan, the Vlan is created but the playbook ends with errors.

tasks:

- name: Create interface  
nxos\_interface:  
interface: Vlan50  
description: “Description”

PLAY [vlan testing] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Create interface] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: NameError: global name ‘ShellError’ is not defined  
fatal: [nxos2]: FAILED! =\> {“changed”: false, “failed”: true, “module\_stderr”: “Traceback (most recent call last):\n File "/tmp/ansible\_BLr8ZB/ansible\_module\_nxos\_interface.py", line 763, in \n main()\n File "/tmp/ansible\_BLr8ZB/ansible\_module\_  
nxos\_interface.py", line 675, in main\n existing, is\_default = smart\_existing(module, intf\_type, normalized\_interface)\n File "/tmp/ansible\_BLr8ZB/ansible\_module\_nxos\_interface.py", line 559, in smart\_existing\n existing = get\_interface(normalized\_in  
terface, module)\n File "/tmp/ansible\_BLr8ZB/ansible\_module\_nxos\_interface.py", line 326, in get\_interface\n attributes = get\_manual\_interface\_attributes(intf, module)\n File "/tmp/ansible\_BLr8ZB/ansible\_module\_nxos\_interface.py", line 248, in get\_man  
ual\_interface\_attributes\n except (IndexError, ShellError):\nNameError: global name ‘ShellError’ is not defined\n”, “module\_stdout”: “”, “msg”: “MODULE FAILURE”, “rc”: 0}  
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: NameError: global name ‘ShellError’ is not defined  
fatal: [nxos1]: FAILED! =\> {“changed”: false, “failed”: true, “module\_stderr”: “Traceback (most recent call last):\n File "/tmp/ansible\_Dwcsun/ansible\_module\_nxos\_interface.py", line 763, in \n main()\n File "/tmp/ansible\_Dwcsun/ansible\_module\_  
nxos\_interface.py", line 675, in main\n existing, is\_default = smart\_existing(module, intf\_type, normalized\_interface)\n File "/tmp/ansible\_Dwcsun/ansible\_module\_nxos\_interface.py", line 559, in smart\_existing\n existing = get\_interface(normalized\_in  
terface, module)\n File "/tmp/ansible\_Dwcsun/ansible\_module\_nxos\_interface.py", line 326, in get\_interface\n attributes = get\_manual\_interface\_attributes(intf, module)\n File "/tmp/ansible\_Dwcsun/ansible\_module\_nxos\_interface.py", line 248, in get\_man  
ual\_interface\_attributes\n except (IndexError, ShellError):\nNameError: global name ‘ShellError’ is not defined\n”, “module\_stdout”: “”, “msg”: “MODULE FAILURE”, “rc”: 0}  
to retry, use: --limit @/vagrant/ansible-nxos/test1.retry

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

nxos1 : ok=0 changed=0 unreachable=0 failed=1  
nxos2 : ok=0 changed=0 unreachable=0 failed=1

ubuntu@ubuntu-xenial:/vagrant/ansible-nxos$ ansible --version  
ansible 2.3.0.0  
config file = /vagrant/ansible-nxos/ansible.cfg  
configured module search path = Default w/o overrides  
python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]  
ubuntu@ubuntu-xenial:/vagrant/ansible-nxos$

When I run the same playbook with other interface type (Ethernet, Loopback) it ends normaly.

Petr
