# Ansible static inventory with dynamic tags for Amazon EC2 Windows instances

**URL:** <https://forum.ansible.com/t/ansible-static-inventory-with-dynamic-tags-for-amazon-ec2-windows-instances/25105>\
**Category:** Ansible Project\
**Tags:** windows, aws\
**Created:** [July 27, 2017, 7:08am UTC](https://forum.ansible.com/t/ansible-static-inventory-with-dynamic-tags-for-amazon-ec2-windows-instances/25105 "2017-07-27T07:08:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Poornima\_Sandireddy](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@Poornima\_Sandireddy](https://forum.ansible.com/u/Poornima_Sandireddy)\
**Post date:** [July 27, 2017, 7:08am UTC](https://forum.ansible.com/t/ansible-static-inventory-with-dynamic-tags-for-amazon-ec2-windows-instances/25105/1 "2017-07-27T07:08:35Z")

</div>

Hi All,

I am working on a project where in agents needs to be installed on running windows instances on AWS account. I need to discover the instances based on tags (ex - tag\_owner\_poornima) but I am facing issues. Below are the configurations that I have made.

hosts :

[win]  
tag\_owner\_poornima

[win:vars]  
ansible\_connection=winrm  
ansible\_ssh\_port=5986  
ansible\_ssh\_user=Administrator  
ansible\_ssh\_pass=myTempPassword123!  
ansible\_winrm\_transport=ntlm  
ansible\_winrm\_server\_cert\_validation=ignore

Under group\_vars/win.yml :

ansible\_user: Administrator  
ansible\_password: myTempPassword123!  
anisble\_port: 5986  
ansibe\_connection: winrm  
ansible\_winrm\_transport: ntlm  
ansible\_winrm\_server\_cert\_validation: ignore

When I run the command- “ansible win -m win\_ping”, I facing the following issue.

tag\_owner\_poornima | UNREACHABLE! =\> {  
“changed”: false,  
“msg”: “ntlm: HTTPSConnectionPool(host=‘tag\_owner\_poornima’, port=5986): Max retries exceeded with url: /wsman (Caused by NewConnectionError(‘\<urllib3.connection.VerifiedHTTPSConnection object at 0x22fc0d0\>: Failed to establish a new connection: [Errno -2] Name or service not known’,))”,  
“unreachable”: true  
}

Could somebody please help me on this.

Thanks in advance.
