Skip to content

error while executing ansible playbook using private key #58

@Vikash-Ro

Description

@Vikash-Ro

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions