NEED HELP - connecting via winrm

201 views
Skip to first unread message

aaron.t...@total.care

unread,
Jun 3, 2016, 10:39:16 AM6/3/16
to Ansible Project
I am having trouble connecting to a windows vm via the ansible winrm connection.
I am using ansible 2.0.2

host settings

[Windows]
GP1-LAB-OPSTST2.com

[Windows_var]
ansible_ssh_user=
ansible_ssh_pass=
ansible_ssh_port=5985
ansible_connection=winrm

ansible returns

root@GP1-LAB-OPSTST1:/etc/ansible# ansible Windows -m win_ping
192.168.30.101.com | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh.",
    "unreachable": true
}
GP1-LAB-OPSTST2.com | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh.",
    "unreachable": true
 
Windows machine

address = *
transport = http
port = 5985
hostname
enabled = true
urlprefix = wsman
certificate thumbprint
listening on = 127.0.0.1, 192.168.30.101, ::1


Any clues as to what to do next?

Matt Davis

unread,
Jun 3, 2016, 11:39:59 AM6/3/16
to Ansible Project
The var definition in your inventory file is wrong- try:

[Windows:vars]

Also, if you're on 2.x you should probably use the new ansible_user/ansible_port/ansible_password vars. The old ansible_ssh_X versions will continue to work, but the new ones are much clearer.
Reply all
Reply to author
Forward
0 new messages