IBM / ansible-for-i

the tool is to provide several customized modules for Ansible to manage IBM i systems.
GNU General Public License v3.0
56 stars 54 forks source link

Not a valid RSA private key file #89

Closed Ludovic-Menard closed 3 years ago

Ludovic-Menard commented 3 years ago

Hello, I am using "sync_apply_ptf_group playbook and I have a problem with the task "TASK [ibm.power_ibmi.sync_apply_ptf_group : Transfer image to target_system]" The error is Not a valid RSA private key file. I have recreated with ssh-keygen on both IBM I partition, the key pair without success. This is the log. Thanks for your help. Ludo

The full traceback is: File "/tmp/ansible_ibmi_sync_files_payload_rduf5cpi/ansible_ibmi_sync_files_payload.zip/ansible_collections/ibm/power_ibmi/plugins/modules/ibmi_sync_files.py", line 225, in main File "/QOpenSys/pkgs/lib/python3.6/site-packages/paramiko/pkey.py", line 206, in from_private_key_file key = cls(filename=filename, password=password) File "/QOpenSys/pkgs/lib/python3.6/site-packages/paramiko/rsakey.py", line 55, in init self._from_private_key_file(filename, password) File "/QOpenSys/pkgs/lib/python3.6/site-packages/paramiko/rsakey.py", line 175, in _from_private_key_file data = self._read_private_key_file("RSA", filename, password) File "/QOpenSys/pkgs/lib/python3.6/site-packages/paramiko/pkey.py", line 279, in _read_private_key_file data = self._read_private_key(tag, f, password) File "/QOpenSys/pkgs/lib/python3.6/site-packages/paramiko/pkey.py", line 289, in _read_private_key raise SSHException("not a valid " + tag + " private key file") fatal: [10.7.19.58 -> 10.3.60.128]: FAILED! => { "changed": false, "delta": "", "fail_list": [ { "fail_reason": "not a valid RSA private key file. ", "src": "/QIBM/UserData/OS/Service/ECS/PTF/2107649895/S8888V01.BIN" } ], "invocation": { "module_args": { "dest": "/ansible/image/2107649895", "private_key": "/home/ANSIBLE/.ssh/id_rsa", "remote_host": "10.7.19.58", "remote_user": "ansible", "src_list": [ { "fail_reason": "not a valid RSA private key file. ", "src": "/QIBM/UserData/OS/Service/ECS/PTF/2107649895/S8888V01.BIN" } ] } }, "msg": "", "rc": 255, "stderr": "Exception. not a valid RSA private key file. Use -vvv for more information.", "stderr_lines": [ "Exception. not a valid RSA private key file. Use -vvv for more information." ], "stdout": "", "stdout_lines": [], "success_list": [] }

LiJunBJZhu commented 3 years ago

Hi Ludo, is your private key a rsa key in the legacy PEM private key format?

Below are some requirements listed in related module/plugin.

notes:

Ludovic-Menard commented 3 years ago

Hi Lijun, thanks a lot for all. I already had paramiko package installed on 2 IBM i. I deleted the old ssh key pair to create PEM format with this command ssh-keygen -t rsa -m PEM. After that, I used ssh-copy-id command to copy the public key on each IBM i. It works fine. Thanks a lot again. I still testing fix management playbooks. Ludo