Azure dynamic inventory default to SSH even for win_ping

19 views
Skip to first unread message

Aravind Sivaraman

unread,
Jan 28, 2020, 3:42:34 PM1/28/20
to Ansible Project
I am testing the Azure Dynamic Inventory plugin, have a windows VM in one of the resource group, when i am trying to do win_ping it default the connection to SSH. How do I specify to use by windows credentials here?

[ansible@NBP-HO7-Ansible01 windows]$ ansible all -m win_ping -i nbpazure_rm.yml -vvv
ansible 2.9.4
  config file = None
  configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ansible/.local/lib/python3.6/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.6.8 (default, Aug  7 2019, 17:28:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
No config file found; using defaults
host_list declined parsing /home/ansible/ansible/windows/nbpazure_rm.yml as it did not pass its verify_file() method
script declined parsing /home/ansible/ansible/windows/nbpazure_rm.yml as it did not pass its verify_file() method
Parsed /home/ansible/ansible/windows/nbpazure_rm.yml inventory source with auto plugin
META: ran handlers
<10.112.1.5> ESTABLISH SSH CONNECTION FOR USER: None
<10.112.1.5> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/ansible/.ansible/cp/1b5f4e058a 10.112.1.5 '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<10.112.1.5> (255, b'', b'ssh: connect to host 10.112.1.5 port 22: Connection timed out\r\n')
an-testvm01_b1ec | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: ssh: connect to host 10.112.1.5 port 22: Connection timed out",
    "unreachable": true

Aravind Sivaraman

unread,
Jan 29, 2020, 12:17:03 PM1/29/20
to Ansible Project
UPDATE:

Update dynamic inventory with keyed group matching group_vars, then it picked up the winrm connection and it works fine
Reply all
Reply to author
Forward
0 new messages