Pure-Storage-Ansible / FlashArray-Collection

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

Failed to collect subset all from Purearray #392

Closed colinet closed 1 year ago

colinet commented 1 year ago

Using below playbook :

- name: pure | array read | collect purearray information
  purestorage.flasharray.purefa_info:
    fa_url: "{{ san_CRUD_purearray_name.url }}"
    api_token: "{{ san_CRUD_purearray_name.token }}"
    gather_subset:
      - all

I get the following message :

TASK [ds-role-san_CRUD : pure | array read | collect purearray information] ************************************************************************************************************************************************************************************************
Wednesday 26 April 2023  17:45:54 +0200 (0:00:00.028)       0:00:01.357 ******* 
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.81.0.114'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings\n  warnings.warn(\n/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.81.0.114'. 
....
init_globals=dict(_module_fqn='ansible_collections.purestorage.flasharray.plugins.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_purestorage.flasharray.purefa_info_payload_wxcmizk1/ansible_purestorage.flasharray.purefa_info_payload.zip/ansible_collections/purestorage/flasharray/plugins/modules/purefa_info.py\", line 1795, in <module>\n  File \"/tmp/ansible_purestorage.flasharray.purefa_info_payload_wxcmizk1/ansible_purestorage.flasharray.purefa_info_payload.zip/ansible_collections/purestorage/flasharray/plugins/modules/purefa_info.py\", line 1734, in main\n  File \"/tmp/ansible_purestorage.flasharray.purefa_info_payload_wxcmizk1/ansible_purestorage.flasharray.purefa_info_payload.zip/ansible_collections/purestorage/flasharray/plugins/modules/purefa_info.py\", line 854, in generate_capacity_dict\nTypeError: 'Space' object is not subscriptable\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

If I collect subset config, it runs as expected.

Environnement is :

[xxxxxxx@yyyyyyyyy ~]$  ansible --version
ansible [core 2.11.9] 
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/rcolinet/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
  ansible collection location = /home/rcolinet/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.14 (main, Jan  9 2023, 00:00:00) [GCC 11.3.1 20220421 (Red Hat 11.3.1-2)]
  jinja version = 3.1.2
  libyaml = True
[xxxxxxx@yyyyyyyyy ~]$
sdodsley commented 1 year ago

@colinet Please confirm the Ansible FlashArray Collection version you are running from

ansible-galaxy collection list

colinet commented 1 year ago

The collection version is :

[xxxxxxxxxxx@xxxxxxxxx ~]$  ansible-galaxy collection list | grep pure
purestorage.flasharray        1.11.0 
purestorage.flashblade        1.8.1  
[xxxxxxxxxxx@xxxxxxxxx ~]$ 

Requirements used are:

[xxxxxxxxxxx@xxxxxxxxx ~]$  pip list | grep pure
purestorage                        1.19.0
py-pure-client                     1.30.0
WARNING: You are using pip version 20.1.1; however, version 23.1.2 is available.
You should consider upgrading via the '/usr/bin/python -m pip install --upgrade pip' command.
[xxxxxxxxxxx@xxxxxxxxx ~]$
sdodsley commented 1 year ago

Please upgrade to the latest version of the Collection (1.17.2) using ansible-galaxy collection install purestorage.flasharray.

That should resolve your problem.

colinet commented 1 year ago

I did the upgrade. It now works with this version of purestorage.flasharray.

Thank you for your support !