vmware-archive / ansible-module-vcloud-director

ansible-module-vcloud-director
Other
112 stars 85 forks source link

Edge Gateway Creation on NSX-T fails: exit_json() argument after ** must be a mapping #194

Closed surfer190 closed 2 years ago

surfer190 commented 3 years ago

TypeError: exit_json() argument after ** must be a mapping, not NoneType

The code is with as minimal as I could get it:

  - name: create Edge Gateway
    vcd_vdc_gateway:
      org_name: "myOrg"
      vdc_name: 'myVdc'
      gateway_name: "EDGE-myOrg_myVdc"
      description: "myOrg"

The error:

The full traceback is:
Traceback (most recent call last):
  File "/Users/stephen/.ansible/tmp/ansible-tmp-1630397782.892952-27190-121007935376147/AnsiballZ_vcd_vdc_gateway.py", line 102, in <module>
    _ansiballz_main()
  File "/Users/stephen/.ansible/tmp/ansible-tmp-1630397782.892952-27190-121007935376147/AnsiballZ_vcd_vdc_gateway.py", line 94, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/Users/stephen/.ansible/tmp/ansible-tmp-1630397782.892952-27190-121007935376147/AnsiballZ_vcd_vdc_gateway.py", line 40, in invoke_module
    runpy.run_module(mod_name='ansible.modules.vcd_vdc_gateway', init_globals=None, run_name='__main__', alter_sys=True)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/var/folders/tz/lx2rh_nj1853_wlh5ypgn9l80000gn/T/ansible_vcd_vdc_gateway_payload_tksbbi1h/ansible_vcd_vdc_gateway_payload.zip/ansible/modules/vcd_vdc_gateway.py", line 643, in <module>
  File "/var/folders/tz/lx2rh_nj1853_wlh5ypgn9l80000gn/T/ansible_vcd_vdc_gateway_payload_tksbbi1h/ansible_vcd_vdc_gateway_payload.zip/ansible/modules/vcd_vdc_gateway.py", line 639, in main
TypeError: exit_json() argument after ** must be a mapping, not NoneType
fatal: [lab]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/Users/stephen/.ansible/tmp/ansible-tmp-1630397782.892952-27190-121007935376147/AnsiballZ_vcd_vdc_gateway.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/Users/stephen/.ansible/tmp/ansible-tmp-1630397782.892952-27190-121007935376147/AnsiballZ_vcd_vdc_gateway.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/Users/stephen/.ansible/tmp/ansible-tmp-1630397782.892952-27190-121007935376147/AnsiballZ_vcd_vdc_gateway.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.vcd_vdc_gateway', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py\", line 207, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/var/folders/tz/lx2rh_nj1853_wlh5ypgn9l80000gn/T/ansible_vcd_vdc_gateway_payload_tksbbi1h/ansible_vcd_vdc_gateway_payload.zip/ansible/modules/vcd_vdc_gateway.py\", line 643, in <module>\n  File \"/var/folders/tz/lx2rh_nj1853_wlh5ypgn9l80000gn/T/ansible_vcd_vdc_gateway_payload_tksbbi1h/ansible_vcd_vdc_gateway_payload.zip/ansible/modules/vcd_vdc_gateway.py\", line 639, in main\nTypeError: exit_json() argument after ** must be a mapping, not NoneType\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}
jeffstu commented 2 years ago

I'm seeing the same error too, Did you get anywhere with it?

surfer190 commented 2 years ago

Yes, these modules do not support NSX-T. I am now using the NSX-T api directly with the ansible uri module - and some templating/manipulation.

jeffstu commented 2 years ago

Yes, these modules do not support NSX-T. I am now using the NSX-T api directly with the ansible uri module - and some templating/manipulation.

Anything you can share for the solution you came up with?