Pure-Storage-Ansible / FlashArray-Collection

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

Use of host_encryption_key incompatible with protocol_endpoint #385

Closed genegr closed 1 year ago

genegr commented 1 year ago

Issue description:

purefa_info module fails when trying to retrieve volumes information if protocol endpoints are defined

Steps to reproduce the behavior:

  1. Make sure at least one protocol enpoint is defined in the array
  2. Run a simple playbook that merely uses purefa_info to gather volumes information.

Expected behavior: The collected list of info is returned

Currrent error:

(ansible-pure-vsphere) egrosso@z-eg-prom:~/ansible-activecluster-3rd-array$ ansible-playbook -i inventory.yaml fainfo.yaml [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

PLAY [localhost] ***

TASK [Retrieve volumes (workaround)] *** fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "/home/egrosso/.virtualenvs/ansible-pure-vsphere/lib/python3.10/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.225.112.10'. 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/egrosso/.virtualenvs/ansible-pure-vsphere/lib/python3.10/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.225.112.10'. 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/egrosso/.virtualenvs/ansible-pure-vsphere/lib/python3.10/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.225.112.10'. 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/egrosso/.virtualenvs/ansible-pure-vsphere/lib/python3.10/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.225.112.10'. 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/egrosso/.virtualenvs/ansible-pure-vsphere/lib/python3.10/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.225.112.10'. 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/egrosso/.virtualenvs/ansible-pure-vsphere/lib/python3.10/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.225.112.10'. 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/egrosso/.virtualenvs/ansible-pure-vsphere/lib/python3.10/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.225.112.10'. 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/egrosso/.virtualenvs/ansible-pure-vsphere/lib/python3.10/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.225.112.10'. 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/egrosso/.virtualenvs/ansible-pure-vsphere/lib/python3.10/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.225.112.10'. 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/egrosso/.virtualenvs/ansible-pure-vsphere/lib/python3.10/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.225.112.10'. 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/egrosso/.ansible/tmp/ansible-tmp-1679314419.1794312-1156620-195178558117854/AnsiballZ_purefa_info.py\", line 107, in \n _ansiballz_main()\n File \"/home/egrosso/.ansible/tmp/ansible-tmp-1679314419.1794312-1156620-195178558117854/AnsiballZ_purefa_info.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/egrosso/.ansible/tmp/ansible-tmp-1679314419.1794312-1156620-195178558117854/AnsiballZ_purefa_info.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.purestorage.flasharray.plugins.modules.purefa_info', init_globals=dict(_module_fqn='ansible_collections.purestorage.flasharray.plugins.modules.purefa_info', _modlib_path=modlib_path),\n File \"/usr/lib/python3.10/runpy.py\", line 224, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.10/runpy.py\", line 96, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_purestorage.flasharray.purefa_info_payload_yn3c33q5/ansible_purestorage.flasharray.purefa_info_payload.zip/ansible_collections/purestorage/flasharray/plugins/modules/purefa_info.py\", line 2218, in \n File \"/tmp/ansible_purestorage.flasharray.purefa_info_payload_yn3c33q5/ansible_purestorage.flasharray.purefa_info_payload.zip/ansible_collections/purestorage/flasharray/plugins/modules/purefa_info.py\", line 2153, in main\n File \"/tmp/ansible_purestorage.flasharray.purefa_info_payload_yn3c33q5/ansible_purestorage.flasharray.purefa_info_payload.zip/ansible_collections/purestorage/flasharray/plugins/modules/purefa_info.py\", line 1376, in generate_vol_dict\n File \"/home/egrosso/.virtualenvs/ansible-pure-vsphere/lib/python3.10/site-packages/purestorage/purestorage.py\", line 773, in list_volumes\n return self._request(\"GET\", \"volume\", kwargs)\n File \"/home/egrosso/.virtualenvs/ansible-pure-vsphere/lib/python3.10/site-packages/purestorage/purestorage.py\", line 191, in _request\n return self._request(method, path, data, False)\n File \"/home/egrosso/.virtualenvs/ansible-pure-vsphere/lib/python3.10/site-packages/purestorage/purestorage.py\", line 202, in _request\n raise PureHTTPError(self._target, str(self._rest_version), response)\npurestorage.purestorage.PureHTTPError: PureHTTPError status code 400 returned by REST version 1.19 at 10.225.112.10: BAD REQUEST\n[{\"msg\": \"rest_service.py: host_encryption_key is not allowed with protocol_endpoint\"}]\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

PLAY RECAP ***** localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0