0

ansible all -m yum -a "name=java-openjdk state=present install_root=/opt/"

I am getting following error 127.0.0.1 | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).", "unreachable": true }

I can run a playbook like below ansible-playbook --connection=local --inventory 127.0.0.1, teamcity.yml

1 Answer 1

0

In your first example you are using whatever connection is specified in your inventory. The second example you specify "connection=local".

Without seeing your inventory and playbook I can't be sure what the best solution is. You could make sure the entry in your hosts file uses the local connection:

 examplehost ansible_connection=local

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .