Skip to content

PureError('Could not read private key file') #124

@nitreddy21

Description

@nitreddy21

While running pure1 ansible playbooks with the following modules purestorage.pure1.pure1_info or purestorage.pure1.pure1_info encountering the following error "Could not read private key file".

verified private key file permissions and its accessible through python env.

The full traceback is:
File "/var/folders/r7/1y7l6xyn1kld815g1wj1brj80000gp/T/ansible_purestorage.pure1.pure1_info_payload_pjai6z3n/ansible_purestorage.pure1.pure1_info_payload.zip/ansible_collections/purestorage/pure1/plugins/module_utils/pure1.py", line 69, in get_pure1
pure_1 = pure1.Client(
File "///.pyenv/versions/3.10.4/envs/ntn-ansible/lib/python3.10/site-packages/pypureclient/pure1/client.py", line 45, in Client
client = pure1_module.Client(**kwargs)
File "///.pyenv/versions/3.10.4/envs/ntn-ansible/lib/python3.10/site-packages/pypureclient/pure1/Pure1_1_3/client.py", line 73, in init
self._token_man = TokenManager(self.TOKEN_ENDPOINT,
File "///.pyenv/versions/3.10.4/envs/ntn-ansible/lib/python3.10/site-packages/pypureclient/token_manager.py", line 58, in init
private_key = self._get_private_key(private_key_file, private_key_password)
File "///.pyenv/versions/3.10.4/envs/ntn-ansible/lib/python3.10/site-packages/pypureclient/token_manager.py", line 72, in _get_private_key
raise PureError('Could not read private key file')
fatal: [localhost]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"app_id": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"gather_subset": [
"minimum"
],
"key_file": "/Users///*/private_key.pem",
"password": null
}
},
"msg": "Unknown failure. Please contact Pure Support"
}

  • name: Test connectivity to Pure1
    hosts: localhost
    gather_facts: no
    tasks:
    • name: Get Pure1 Info
      purestorage.pure1.pure1_info:
      app_id: "{{ pure1_app_id }}"
      key_file: "{{ pure1_key_file }}"
      register: pure1_info

    • name: Display Pure1 Connection Info
      debug:
      var: pure1_info

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions