Unable to run ansible command using aws ec2 dynamic inventory

16 views
Skip to first unread message

Ravi Tiwary

unread,
Aug 22, 2018, 6:03:57 PM8/22/18
to Ansible Project
I am trying to run ansible command sudo ansible -i ./dynamic-inventory/ec2.py tag_Name_aws_test_win -m win_ping
using module win_ping from ansible server to remote node and it is throwing error 
aws_test_win | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: ssh  connect to host 172.31.1.10 port 22:

I have defined variables in yml file under group_vars call tag_Name_aws_test_win

ansible_user: 'ansible'
ansible_password: 'XXXXXXXXXXXXX'
ansible_winrm_transport: credssp
ansible_port: '5985'
ansible_connection: 'winrm'

ansible_winrm_server_cert_validation: ignore
validate_certs: false

Please advise if I missing something.

Ravi Tiwary

unread,
Aug 22, 2018, 6:08:44 PM8/22/18
to Ansible Project
When i run the same command for same host using static inventory, it works
Reply all
Reply to author
Forward
0 new messages