SSH Connection fails. Permission denied. Publickey, keyboard-interactive

Hi All,

New to Ansible. New to the group.

Trying to run some basic commands against my VMware environment and thought I would start with vmware_facts.

ansible 2.4.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible 

python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]

Ubuntu 16.0.4

My hosts file looks like this:

`
[all]

[windows]
TestServ
TestServ1

[vsphere]
host1 ansible_connection=ssh ansible_user=root ansible_host=10.0.0.1
host2 ansible_user=root ansible_connection=ssh ansible_host=10.0.0.2

[localhost]
127.0.0.1 ansible_connection=local

`

I can successfully run the following command

`
ansible vsphere -i hosts -m ping --ask-pass -vvv

SUCCESS => {
“changed”: false,
“failed”: false,
“invocation”: {
“module_args”: {
“data”: “pong”
}
},
“ping”: “pong”

`

After some research, here is the playbook that I came up with.

`

I think I solved my problem. I re-wrote the playbook to look like this and it now gets vmware_facts as expected.

`