Pure-Storage-Ansible / FlashArray-Collection

Ansible Collection for Pure Storage FlashArray
GNU General Public License v3.0
19 stars 21 forks source link

Error while changing interfacenot fixed by #565 #566

Closed Natscho2001 closed 1 month ago

Natscho2001 commented 1 month ago
          Thanks for your reply, but that did not fix the issue. 

I update the collection successfully

ansible-galaxy collection install -U -f purestorage.flasharray
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Downloading 
purestorage.flasharray:1.28.0 was installed successfully

An added the lines provided

322-    if not current_state["address"]:
323:        current_state["address"] = "0.0.0.0"
--
384-        if not address:
385:            address = "0.0.0.0"

But still get

Traceback (most recent call last):
  File \"/home/../.ansible/tmp/ansible-tmp-1714978601.4099014-513915-231433368316548/AnsiballZ_purefa_network.py\", line 107, in <module>
    _ansiballz_main()
  File \"/home/../.ansible/tmp/ansible-tmp-1714978601.4099014-513915-231433368316548/AnsiballZ_purefa_network.py\", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File \"/home/../.ansible/tmp/ansible-tmp-1714978601.4099014-513915-231433368316548/AnsiballZ_purefa_network.py\", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.purestorage.flasharray.plugins.modules.purefa_network', init_globals=dict(_module_fqn='ansible_collections.purestorage.flasharray.plugins.modules.purefa_network', _modlib_path=modlib_path),
  File \"<frozen runpy>\", line 226, in run_module
  File \"<frozen runpy>\", line 98, in _run_module_code
  File \"<frozen runpy>\", line 88, in _run_code
  File \"/tmp/ansible_purestorage.flasharray.purefa_network_payload__e2_ayub/ansible_purestorage.flasharray.purefa_network_payload.zip/ansible_collections/purestorage/flasharray/plugins/modules/purefa_network.py\", line 773, in <module>
  File \"/tmp/ansible_purestorage.flasharray.purefa_network_payload__e2_ayub/ansible_purestorage.flasharray.purefa_network_payload.zip/ansible_collections/purestorage/flasharray/plugins/modules/purefa_network.py\", line 743, in main
  File \"/tmp/ansible_purestorage.flasharray.purefa_network_payload__e2_ayub/ansible_purestorage.flasharray.purefa_network_payload.zip/ansible_collections/purestorage/flasharray/plugins/modules/purefa_network.py\", line 344, in update_interface
  File \"/home/../.local/lib/python3.11/site-packages/netaddr/strategy/ipv4.py\", line 99, in valid_str
    raise TypeError('Invalid type: %s' % type(addr))
TypeError: Invalid type: <class 'NoneType'>
", "module_stdout": "", "msg": "MODULE FAILURE
See stdout/stderr for the exact error", "rc": 1}

Originally posted by @Natscho2001 in https://github.com/Pure-Storage-Ansible/FlashArray-Collection/issues/563#issuecomment-2095320619

sdodsley commented 1 month ago

Please try the new patch to see if that fixes the issue. This needs to be applied on top of the previously provided patch

Natscho2001 commented 1 month ago

Great, thanks! That is working:

Setting an IP

TASK [pure_management : FlashArray > array_basic> Set array replication] ******************************************************************************************************************
changed: [linpure18 -> localhost] => (item={'name': 'ct0.eth2', 'address': '10.1.2.4/26', 'gateway': '0.0.0.0'})
changed: [linpure18 -> localhost] => (item={'name': 'ct1.eth2', 'address': '10.1.2.5/26', 'gateway': '0.0.0.0'})

and clearing the IP config

TASK [pure_management : FlashArray > array_basic> Set array replication] ******************************************************************************************************************
changed: [linpure18 -> localhost] => (item={'name': 'ct0.eth2', 'address': '0.0.0.0/0', 'gateway': '0.0.0.0'})
changed: [linpure18 -> localhost] => (item={'name': 'ct1.eth2', 'address': '0.0.0.0/0', 'gateway': '0.0.0.0'})

Thanks for your help!