Pure-Storage-Ansible / FlashArray-Collection

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

Module purefa_info error #510

Closed colinet closed 9 months ago

colinet commented 10 months ago

Describe the bug Running below playbook triggers an internal error:

- name: Pure | helpers info | collect data
  purefa_info:
    fa_url: "{{ san_CRUD_purearray_name[_pure_info_array_name | lower].url }}"
    api_token: "{{ san_CRUD_purearray_name[_pure_info_array_name | lower].token }}"
    gather_subset:
      - hgroups
      - hosts
      - volumes
      - vgroups
      - pgroups
  register: _pure_info_content

The error reported is:

TASK [ds-role-san_CRUD : Pure | helpers info | collect data] *************************************************************************************************************************
Friday 24 November 2023  13:27:02 +0100 (0:00:00.056)       0:00:17.827 ******* 

fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "/home/xxxxxxxx/.local/lib/python3.9/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.81.0.130'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings\n 
warnings.warn(\n/home/xxxxxxxx/.local/lib/python3.9/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.81.0.130'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings\n  
warnings.warn(\n/home/xxxxxxxx/.local/lib/python3.9/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.81.0.130'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings\n  
warnings.warn(\n/home/xxxxxxxx/.local/lib/python3.9/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.81.0.130'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings\n  
warnings.warn(\n/home/xxxxxxxx/.local/lib/python3.9/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.81.0.130'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings\n  
warnings.warn(\n/home/xxxxxxxx/.local/lib/python3.9/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.81.0.130'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings\n  
warnings.warn(\nTraceback (most recent call last):\n  
File \"/home/xxxxxxxx/.ansible/tmp/ansible-tmp-1700828822.361825-2931826-232720906978089/AnsiballZ_purefa_info.py\", line 107, in <module>\n    _ansiballz_main()\n  
File \"/home/xxxxxxxx/.ansible/tmp/ansible-tmp-1700828822.361825-2931826-232720906978089/AnsiballZ_purefa_info.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  
File \"/home/xxxxxxxx/.ansible/tmp/ansible-tmp-1700828822.361825-2931826-232720906978089/AnsiballZ_purefa_info.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.purefa_info', init_globals=dict(_module_fqn='ansible.modules.purefa_info', _modlib_path=modlib_path),\n  
File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  
File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  
File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  
File \"/tmp/ansible_purefa_info_payload_z2ylbxxo/ansible_purefa_info_payload.zip/ansible/modules/purefa_info.py\", line 2372, in <module>\n  
File \"/tmp/ansible_purefa_info_payload_z2ylbxxo/ansible_purefa_info_payload.zip/ansible/modules/purefa_info.py\", line 2307, in main\n  
File \"/tmp/ansible_purefa_info_payload_z2ylbxxo/ansible_purefa_info_payload.zip/ansible/modules/purefa_info.py\", line 1421, in generate_pgroups_dict\nKeyError: 'SQL-Destination-pur04-instance1::pgroup-auto'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

To Reproduce Run above playbook.

Expected behavior List of subsets of the Pure array

Desktop (please complete the following information): Ansible version:

[xxxxxxxx@xxxxxxxxxxx~]$  ansible --version
ansible [core 2.15.0]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/xxxxxxxx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
  ansible collection location = /home/xxxxxxxx/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.16 (main, May 29 2023, 00:00:00) [GCC 11.3.1 20221121 (Red Hat 11.3.1-4)] (/usr/bin/python)
  jinja version = 3.1.2
  libyaml = True
[xxxxxxxx@xxxxxxxxxxx~]$

Ansible Pure collection:


[xxxxxx@xxxxxxxxxxx~]$  ansible-galaxy collection list | grep -i pure
purestorage.flasharray        1.21.0 
purestorage.flasharray        1.18.0 
purestorage.flashblade        1.11.0 
purestorage.fusion            1.4.2  
[xxxxxxx@xxxxxxxxxx~]$

I also applied patches related to bug #443 and #409

As per the stack trace, it is related to PGroup collect
sdodsley commented 10 months ago

Please upgrade to FlashArray Collection 1.23.1 and see if the issue is still there. If it is please provide the verbose log of the failure

colinet commented 9 months ago

I eventually upgraded the Pure Ansible collection to 1.24.0. The playbook runs as expected. Thx