Dynamic Inventory for Windows EC2 Instances

11 views
Skip to first unread message

Pawan Sawalani

unread,
Dec 10, 2018, 7:45:25 AM12/10/18
to Ansible Project
Hi All,

I am trying to use  EC2 external inventory script (ec2.py/ec2.ini) for AWS instances.

All my AWS EC2 instances are Windows hosts.

When I run below command:

ansible ec2 -i /etc/ansible/ec2.py -m win_ping

I get below error:

172.31.86.58 | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: ssh: connect to host 172.31.86.58 port 22: Connection timed out\r\n",
    "unreachable": true
}

How do I edit ec2.ini/ec2.py, so that it tries connecting only via winrm and not using ssh?

Regards,
Pawan Sawalani
Reply all
Reply to author
Forward
0 new messages