Closed DungKHoang closed 4 years ago
@DungKHoang I reran the playbook and I'm not able to reproduce the error, the playbook is working fine for me with the EV details given and it created the network in OV appliance without any error. Please make sure you are using the latest ansible and python SDK version.
Given playbook is running without any error and informed the user as well. Hence, closing it.
Scenario/Intent
Create ethenert network with ansible using example
Environment Details
Steps to Reproduce
Use the sample ethernetnetwork.yml in the examples folder
name: Configure Ethernet networks from csv hosts: localhost vars: config: 'oneview_config.json' tasks:
name: Create an Ethernet Network oneview_ethernet_network: config: "{{ config }}" state: present data: name: 'test' vlanId: 200 ethernetNetworkType: 'Tagged' purpose: 'General' smartLink: false privateNetwork: false
delegate_to: localhost
Expected Result
network is created but the playbook creates an error
Actual Result
Error is: An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: Value of unknown type: <class 'hpOneView.resources.networking.ethernet_networks.EthernetNetworks'>, <hpOneView.resources.networking.ethernet_networks.EthernetNetworks object at 0x7f4e2681d0f0> fatal: [localhost -> localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/dung/.ansible/tmp/ansible-tmp-1585619989.570344-44450120699480/AnsiballZ_oneview_ethernet_network.py\", line 102, in\n _ansiballz_main()\n File \"/home/dung/.ansible/tmp/ansible-tmp-1585619989.570344-44450120699480/AnsiballZ_oneview_ethernet_network.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/dung/.ansible/tmp/ansible-tmp-1585619989.570344-44450120699480/AnsiballZ_oneview_ethernet_network.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible.modules.remote_management.oneview.oneview_ethernet_network', init_globals=None, run_name='main', alter_sys=True)\n File \"/usr/lib/python3.6/runpy.py\", line 205, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.6/runpy.py\", line 96, in _run_module_code\n mod_name, mod_spec, pkg_name, script_name)\n File \"/usr/lib/python3.6/runpy.py\", line 85, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_oneview_ethernet_network_payload_8_2u2jso/ansible_oneview_ethernet_network_payload.zip/ansible/modules/remote_management/oneview/oneview_ethernet_network.py\", line 251, in \n File \"/tmp/ansible_oneview_ethernet_network_payload_8_2u2jso/ansible_oneview_ethernet_network_payload.zip/ansible/modules/remote_management/oneview/oneview_ethernet_network.py\", line 247, in main\n File \"/tmp/ansible_oneview_ethernet_network_payload_8_2u2jso/ansible_oneview_ethernet_network_payload.zip/ansible/module_utils/oneview.py\", line 306, in run\n File \"/tmp/ansible_oneview_ethernet_network_payload_8_2u2jso/ansible_oneview_ethernet_network_payload.zip/ansible/module_utils/basic.py\", line 2071, in exit_json\n self._return_formatted(kwargs)\n File \"/tmp/ansible_oneview_ethernet_network_payload_8_2u2jso/ansible_oneview_ethernet_network_payload.zip/ansible/module_utils/basic.py\", line 2064, in _return_formatted\n kwargs = remove_values(kwargs, self.no_log_values)\n File \"/tmp/ansible_oneview_ethernet_network_payload_8_2u2jso/ansible_oneview_ethernet_network_payload.zip/ansible/module_utils/basic.py\", line 418, in remove_values\n new_elem = _remove_values_conditions(old_elem, no_log_strings, deferred_removals)\n File \"/tmp/ansible_oneview_ethernet_network_payload_8_2u2jso/ansible_oneview_ethernet_network_payload.zip/ansible/module_utils/basic.py\", line 401, in _remove_values_conditions\n raise TypeError('Value of unknown type: %s, %s' % (type(value), value))\nTypeError: Value of unknown type: <class 'hpOneView.resources.networking.ethernet_networks.EthernetNetworks'>, <hpOneView.resources.networking.ethernet_networks.EthernetNetworks object at 0x7f4e2681d0f0>\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}