getting an unreachable error when I try to execute ansible playbook using private key and the log shows an entry like :
'Error: Using /etc/ansible/ansible.cfg as config file\n\nPLAY [all] *********************************************************************\n\nTASK [Ping all hosts] **********************************************************\nfatal: [192.168.29.102]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: command-line line 0: garbage at end of line; \"PrivateKey.pem\".", "unreachable": true}\n\nPLAY RECAP *********************************************************************\n192.168.29.102 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
here I am trying to execute the command :
var command = new Ansible.Playbook().inventory(inventory).playbook('ping').privateKey("PrivateKey.pem").verbose('v').
command.exec();
the issue i am facing is that the private key is being accepted along with quotes or a new line character or a forward slash, Is there a workaround for this, please help!
getting an unreachable error when I try to execute ansible playbook using private key and the log shows an entry like :
'Error: Using /etc/ansible/ansible.cfg as config file\n\nPLAY [all] *********************************************************************\n\nTASK [Ping all hosts] **********************************************************\nfatal: [192.168.29.102]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: command-line line 0: garbage at end of line; \"PrivateKey.pem\".", "unreachable": true}\n\nPLAY RECAP *********************************************************************\n192.168.29.102 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
here I am trying to execute the command :
var command = new Ansible.Playbook().inventory(inventory).playbook('ping').privateKey("PrivateKey.pem").verbose('v').
command.exec();
the issue i am facing is that the private key is being accepted along with quotes or a new line character or a forward slash, Is there a workaround for this, please help!