I'm trying to automate google cloud virtual instances remotely only using external ip addresses of virtual machines. I can ssh into the virtual machines using command line with user name
shishir9159_gmail_com . But If I use any ansible commands like this:
ansible -i hosts -u shishir9159_gmail_com --private-key=~/.ssh/google_compute_engine -m ping all
and it results in this following error:
"msg": "Failed to connect to the host via ssh: firstname.lastname@example.org: Permission denied (publickey,gssapi-keyex,gssapi-with-mic)."
I've used some parameters in my ansible.cfg:
host_key_checking = False ssh_args = -o ControlMaster=no
But I don't think they do much of a help according to this post:
And I tried many methods and recommendations. I have a service account but it doesn't seem to me necessary for this simple ping command.