Dynamic Inventory for Windows EC2 Instances

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