last person joined: 4 hours ago 

Expand all | Collapse all

AOS-CX Role in Ansible issue

Jump to Best Answer
  • 1.  AOS-CX Role in Ansible issue

    Posted Nov 13, 2019 05:55 AM



    Starting new topic (original post


    I am trying to test the Ansible module for CX in my lab with the 10.04 OVA, but I have a hard time to get the basic connection to work.


    I first added the role to my existing Linux Mint test host, that gave me error below.

    Then I installed a clean, new Ubuntu 18.04LTS host, followed the instructions of the other article (


    But when I try the basic L3 port or the vlan config example, the play shows an error. When I run it with the verbose option, I get this error output:



    An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'has_key'
    fatal: [sw-access1]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\
      File \"/home/labadmin/.ansible/tmp/ansible-local-10451VX2f6D/ansible-tmp-1573554454.14-69301531100280/\", line 102, in <module>
    _ansiballz_main() File \"/home/labadmin/.ansible/tmp/ansible-local-10451VX2f6D/ansible-tmp-1573554454.14-69301531100280/\", line 94, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File \"/home/labadmin/.ansible/tmp/ansible-local-10451VX2f6D/ansible-tmp-1573554454.14-69301531100280/\", line 40, in invoke_module runpy.run_module(mod_name='ansible.modules.aoscx_vlan', init_globals=None, run_name='__main__', alter_sys=False)
    File \"/usr/lib/python2.7/\", line 192, in run_module fname, loader, pkg_name) File \"/usr/lib/python2.7/\", line 72, in _run_code exec code in run_globals File \"/tmp/ansible_aoscx_vlan_payload_CU2cXY/\", line 146, in <module> File \"/tmp/ansible_aoscx_vlan_payload_CU2cXY/\", line 106, in main File \"/tmp/ansible_aoscx_vlan_payload_CU2cXY/\", line 29, in create_vlan AttributeError: 'NoneType' object has no attribute 'has_key' ", "module_stdout": "", "msg": "MODULE FAILURE See stdout/stderr for the exact error", "rc": 1}

    I have tried this with the role installed from Github and from Ansible Galaxy. I have tried to remove the role and re-install it. It always gave me the error above.


    I ran a tcpdump and the ansible host is not even attempting to connect to the target system, so something seems wrong with my local installation.


    Any clues on what I'm missing?

  • 2.  RE: AOS-CX Role in Ansible issue
    Best Answer

    Posted Nov 13, 2019 05:47 PM



    I believe this was an issue introduced with the new 2.9 Ansible version, I just uploaded a fix on to the aoscx-role ! If you could re-install the latest version, and re-test, we can see if that resolved your issue!


  • 3.  RE: AOS-CX Role in Ansible issue

    Posted Nov 14, 2019 03:27 AM

    Thank you Tiffany,

    The new version 1.0.5 works fine!