Flashblade & Ansible collection
Hello community, We are facing some issues with our FlashBlade when provisioning policies with Ansible. We have updated all the components (py-pure-client and the collection), and we are failing on a simple policy deployment. - name: Test purestorage.flashblade.purefb_policy: name: "filesystem_export_policy" enabled: True policy_type: "nfs" at: True client: "mynfsexport.flashblade.local" secure: True security: "sys" permission: "rw" access: "no-squash" fb_url: "{{ fb_host }}" api_token: "{{ fb_api_token }}" The complete stack trace is : The full traceback is: Traceback (most recent call last): File "/home/user/.ansible/tmp/ansible-tmp-1778656887.1852276-3067455-48057529014464/AnsiballZ_purefb_policy.py", line 107, in <module> _ansiballz_main() File "/home/user/.ansible/tmp/ansible-tmp-1778656887.1852276-3067455-48057529014464/AnsiballZ_purefb_policy.py", line 99, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File "/home/user/.ansible/tmp/ansible-tmp-1778656887.1852276-3067455-48057529014464/AnsiballZ_purefb_policy.py", line 47, in invoke_module runpy.run_module(mod_name='ansible_collections.purestorage.flashblade.plugins.modules.purefb_policy', init_globals=dict(_module_fqn='ansible_collections.purestorage.flashblade.plugins.modules.purefb_policy', _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 "/opt/tmp/tmp/ansible_purestorage.flashblade.purefb_policy_payload_xaietsz7/ansible_purestorage.flashblade.purefb_policy_payload.zip/ansible_collections/purestorage/flashblade/plugins/modules/purefb_policy.py", line 4233, in <module> File "/opt/tmp/tmp/ansible_purestorage.flashblade.purefb_policy_payload_xaietsz7/ansible_purestorage.flashblade.purefb_policy_payload.zip/ansible_collections/purestorage/flashblade/plugins/modules/purefb_policy.py", line 4008, in main File "/opt/tmp/tmp/ansible_purestorage.flashblade.purefb_policy_payload_xaietsz7/ansible_purestorage.flashblade.purefb_policy_payload.zip/ansible_collections/purestorage/flashblade/plugins/modules/purefb_policy.py", line 2392, in update_nfs_policy AttributeError: 'ErrorResponse' object has no attribute 'items' fatal: [localhost]: FAILED! => { "changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/user/.ansible/tmp/ansible-tmp-1778656887.1852276-3067455-48057529014464/AnsiballZ_purefb_policy.py\", line 107, in <module>\n _ansiballz_main()\n File \"/home/user/.ansible/tmp/ansible-tmp-1778656887.1852276-3067455-48057529014464/AnsiballZ_purefb_policy.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/user/.ansible/tmp/ansible-tmp-1778656887.1852276-3067455-48057529014464/AnsiballZ_purefb_policy.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.purestorage.flashblade.plugins.modules.purefb_policy', init_globals=dict(_module_fqn='ansible_collections.purestorage.flashblade.plugins.modules.purefb_policy', _modlib_path=modlib_path),\n File \"<frozen runpy>\", line 226, in run_module\n File \"<frozen runpy>\", line 98, in _run_module_code\n File \"<frozen runpy>\", line 88, in _run_code\n File \"/opt/tmp/tmp/ansible_purestorage.flashblade.purefb_policy_payload_xaietsz7/ansible_purestorage.flashblade.purefb_policy_payload.zip/ansible_collections/purestorage/flashblade/plugins/modules/purefb_policy.py\", line 4233, in <module>\n File \"/opt/tmp/tmp/ansible_purestorage.flashblade.purefb_policy_payload_xaietsz7/ansible_purestorage.flashblade.purefb_policy_payload.zip/ansible_collections/purestorage/flashblade/plugins/modules/purefb_policy.py\", line 4008, in main\n File \"/opt/tmp/tmp/ansible_purestorage.flashblade.purefb_policy_payload_xaietsz7/ansible_purestorage.flashblade.purefb_policy_payload.zip/ansible_collections/purestorage/flashblade/plugins/modules/purefb_policy.py\", line 2392, in update_nfs_policy\nAttributeError: 'ErrorResponse' object has no attribute 'items'\n", "module_stdout": "", "msg": "MODULE FAILURE: No start of json char found\nSee stdout/stderr for the exact error", "rc": 1 } If the policy is already set, the playbook runs perfectly fine. The problem occurs when a new policy is injected. However, we have to install the collection from GitHub. It seems that the artifact built and installed by Ansible Galaxy is not correct. Some commits are not propagated. For example, with the FlashBlade collection 1.24 (installed from Galaxy), we have: >>> from pypureclient.flashblade import ( ... PolicyRuleObjectAccessCondition, ... PolicyRuleObjectAccessPost, ... PolicyRuleObjectAccess, ... NfsExportPolicy, ... NfsExportPolicyRule, ... Policy, ... PolicyPatch, ... PolicyRule, ... SmbSharePolicyRule, ... SmbSharePolicy, ... SmbClientPolicyRule, ... SmbClientPolicy, ... ObjectStoreAccessPolicyPost, ... NetworkAccessPolicy, ... NetworkAccessPolicyRule, ... WormDataPolicy, ... ) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/user/conda/envs/ansible/lib/python3.12/site-packages/pypureclient/flashblade/__init__.py", line 40, in __getattr__ raise ImportError(f'module {__package__} has no attribute {name}') ImportError: module pypureclient.flashblade has no attribute PolicyPatch We have compared the archive from GitHub and there are many differences with the upstream collection code. To help, find my my env package : Package Version ----------------- ----------- annotated-types 0.7.0 ansible-core 2.18.5 bcrypt 5.0.0 certifi 2026.4.22 cffi 2.0.0 cryptography 44.0.0 dnspython 2.8.0 invoke 3.0.3 Jinja2 3.1.4 MarkupSafe 2.1.1 packaging 24.1 paramiko 5.0.0 pip 24.2 py-pure-client 1.88.0 pycparser 2.22 pydantic 2.13.4 pydantic_core 2.46.4 PyJWT 2.12.1 PyNaCl 1.6.2 python-dateutil 2.9.0.post0 PyYAML 6.0.2 resolvelib 1.0.1 setuptools 75.8.2 six 1.17.0 typing_extensions 4.15.0 typing-inspection 0.4.2 urllib3 2.7.0 wheel 0.45.0 And our flashblades are running the Purity//FB 4.6.9. If anyone has a lead to help us get our Ansible back up and running, I thank them in advance. We appreciate your help. Matth80Views0likes2CommentsWe are using the Ansible Modules to run some testing.
We are using the Ansible Modules to run some testing. Anytime we try to use the purefa_info module in the purestorage.flasharray collection. This is the error we get, other modules work fine. Anyone encounter this have any guidance. `TASK [Grab info] ***********************************************************************************************************************************************************************************` fatal: [localhost]: FAILED! => {“changed”: false, “module_stderr”: “/usr/local/Cellar/ansible/7.3.0/libexec/lib/python3.11/site-packages/urllib3/connectionpool.py InsecureRequestWarning: Unverified HTTPS request is being made to host ‘http://us-wcp-sp-pur-lab-01.qvcdev.qvc.net|us-wcp-sp-pur-lab-01.qvcdev.qvc.net’. 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/Cellar/ansible/7.3.0/libexec/lib/python3.11/site-packages/urllib3/connectionpool.py InsecureRequestWarning: Unverified HTTPS request is being made to host ‘http://us-wcp-sp-pur-lab-01.qvcdev.qvc.net|us-wcp-sp-pur-lab-01.qvcdev.qvc.net’. 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/Cellar/ansible/7.3.0/libexec/lib/python3.11/site-packages/urllib3/connectionpool.py InsecureRequestWarning: Unverified HTTPS request is being made to host ‘http://us-wcp-sp-pur-lab-01.qvcdev.qvc.net|us-wcp-sp-pur-lab-01.qvcdev.qvc.net’. 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/Cellar/ansible/7.3.0/libexec/lib/python3.11/site-packages/urllib3/connectionpool.py InsecureRequestWarning: Unverified HTTPS request is being made to host ‘http://us-wcp-sp-pur-lab-01.qvcdev.qvc.net|us-wcp-sp-pur-lab-01.qvcdev.qvc.net’. 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/Cellar/ansible/7.3.0/libexec/lib/python3.11/site-packages/urllib3/connectionpool.py InsecureRequestWarning: Unverified HTTPS request is being made to host ‘http://us-wcp-sp-pur-lab-01.qvcdev.qvc.net|us-wcp-sp-pur-lab-01.qvcdev.qvc.net’. 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/Cellar/ansible/7.3.0/libexec/lib/python3.11/site-packages/urllib3/connectionpool.py InsecureRequestWarning: Unverified HTTPS request is being made to host ‘http://us-wcp-sp-pur-lab-01.qvcdev.qvc.net|us-wcp-sp-pur-lab-01.qvcdev.qvc.net’. 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/Cellar/ansible/7.3.0/libexec/lib/python3.11/site-packages/urllib3/connectionpool.py InsecureRequestWarning: Unverified HTTPS request is being made to host ‘http://us-wcp-sp-pur-lab-01.qvcdev.qvc.net|us-wcp-sp-pur-lab-01.qvcdev.qvc.net’. 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/Cellar/ansible/7.3.0/libexec/lib/python3.11/site-packages/urllib3/connectionpool.py InsecureRequestWarning: Unverified HTTPS request is being made to host ‘http://us-wcp-sp-pur-lab-01.qvcdev.qvc.net|us-wcp-sp-pur-lab-01.qvcdev.qvc.net’. 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/Cellar/ansible/7.3.0/libexec/lib/python3.11/site-packages/urllib3/connectionpool.py InsecureRequestWarning: Unverified HTTPS request is being made to host ‘http://us-wcp-sp-pur-lab-01.qvcdev.qvc.net|us-wcp-sp-pur-lab-01.qvcdev.qvc.net’. 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/Cellar/ansible/7.3.0/libexec/lib/python3.11/site-packages/urllib3/connectionpool.py InsecureRequestWarning: Unverified HTTPS request is being made to host ‘http://us-wcp-sp-pur-lab-01.qvcdev.qvc.net|us-wcp-sp-pur-lab-01.qvcdev.qvc.net’. 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/Cellar/ansible/7.3.0/libexec/lib/python3.11/site-packages/urllib3/connectionpool.py InsecureRequestWarning: Unverified HTTPS request is being made to host ‘http://us-wcp-sp-pur-lab-01.qvcdev.qvc.net|us-wcp-sp-pur-lab-01.qvcdev.qvc.net’. 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 \“/Users/q1431233/.ansible/tmp/ansible-tmp-1680037549.953009-19922-124783552331072/AnsiballZ_purefa_info.py\“, line 107, in <module>\n _ansiballz_main()\n File \“/Users/q1431233/.ansible/tmp/ansible-tmp-1680037549.953009-19922-124783552331072/AnsiballZ_purefa_info.py\“, line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \“/Users/q1431233/.ansible/tmp/ansible-tmp-1680037549.953009-19922-124783552331072/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 \“<frozen runpy>\“, line 226, in run_module\n File \“<frozen runpy>\“, line 98, in _run_module_code\n File \“<frozen runpy>\“, line 88, in _run_code\n File \“/var/folders/fb/vw9q4b9d5xs9wmrsx3s56cdjsggj6w/T/ansible_purefa_info_payload_wsm285r2/ansible_purefa_info_payload.zip/ansible_collections/purestorage/flasharray/plugins/modules/purefa_info.py\“, line 2083, in <module>\n File \“/var/folders/fb/vw9q4b9d5xs9wmrsx3s56cdjsggj6w/T/ansible_purefa_info_payload_wsm285r2/ansible_purefa_info_payload.zip/ansible_collections/purestorage/flasharray/plugins/modules/purefa_info.py\“, line 2008, in main\n File \“/var/folders/fb/vw9q4b9d5xs9wmrsx3s56cdjsggj6w/T/ansible_purefa_info_payload_wsm285r2/ansible_purefa_info_payload.zip/ansible_collections/purestorage/flasharray/plugins/modules/purefa_info.py\“, line 583, in generate_config_dict\n File \“/usr/local/lib/python3.11/site-packages/pypureclient/flasharray/FA_2_17/client.py\“, line 7133, in get_directory_services\n return self._call_api(endpoint, kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \“/usr/local/lib/python3.11/site-packages/pypureclient/flasharray/FA_2_17/client.py\“, line 28551, in _call_api\n response = api_function(**kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^\n File \“/usr/local/lib/python3.11/site-packages/pypureclient/flasharray/FA_2_17/api/directory_services_api.py\“, line 132, in api217_directory_services_get_with_http_info\n return self.api_client.call_api(\n ^^^^^^^^^^^^^^^^^^^^^^^^^\n File \“/usr/local/lib/python3.11/site-packages/pypureclient/flasharray/FA_2_17/api_client.py\“, line 327, in call_api\n return self.__call_api(resource_path, method,\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \“/usr/local/lib/python3.11/site-packages/pypureclient/flasharray/FA_2_17/api_client.py\“, line 170, in __call_api\n return_data = self.deserialize(response_data, response_type)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \“/usr/local/lib/python3.11/site-packages/pypureclient/flasharray/FA_2_17/api_client.py\“, line 243, in deserialize\n return self.__deserialize(data, response_type)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \“/usr/local/lib/python3.11/site-packages/pypureclient/flasharray/FA_2_17/api_client.py\“, line 282, in __deserialize\n return self.__deserialize_model(data, klass)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \“/usr/local/lib/python3.11/site-packages/pypureclient/flasharray/FA_2_17/api_client.py\“, line 632, in __deserialize_model\n kwargs[attr] = self.__deserialize(value, attr_type)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \“/usr/local/lib/python3.11/site-packages/pypureclient/flasharray/FA_2_17/api_client.py\“, line 259, in __deserialize\n return [self.__deserialize(sub_data, sub_kls)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \“/usr/local/lib/python3.11/site-packages/pypureclient/flasharray/FA_2_17/api_client.py\“, line 259, in <listcomp>\n return [self.__deserialize(sub_data, sub_kls)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \“/usr/local/lib/python3.11/site-packages/pypureclient/flasharray/FA_2_17/api_client.py\“, line 282, in __deserialize\n return self.__deserialize_model(data, klass)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \“/usr/local/lib/python3.11/site-packages/pypureclient/flasharray/FA_2_17/api_client.py\“, line 634, in __deserialize_model\n instance = klass(**kwargs)\n ^^^^^^^^^^^^^^^\n File \“/usr/local/lib/python3.11/site-packages/pypureclient/flasharray/FA_2_17/models/directory_service.py\“, line 96, in __init__\n http://self.ca|self.ca_certificate = ca_certificate\n ^^^^^^^^^^^^^^^^^^^\n File \“/usr/local/lib/python3.11/site-packages/pypureclient/flasharray/FA_2_17/models/directory_service.py\“, line 113, in __setattr__\n raise ValueError(\“Invalid value for `ca_certificate`, length must be less than or equal to `3000`\“)\nValueError: Invalid value for `ca_certificate`, length must be less than or equal to `3000`\n”, “module_stdout”: “”, “msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”, “rc”: 1}135Views0likes0Comments