I believe I may know what is happening and this was fixed in the latest 
devel branch so you can try that out if you like. Looks like it is failing 
to gather facts before it gets to your debug task, can you set *gather_facts: 
no* in your playbook as I'm really curious if the cert validation is being 
set properly.

A few other things that would be helpful to know

* Run *pip list* and post the output
* What version of Ansible are you on
* What version of Python 2.7 are you on
* If you turn on fact gathering, does it would if you explicitly set the 
ignore var on the stat task like so

- win_stat:
    path: C:\Users
  vars:
    ansible_winrm_server_cert_validation: ignore

Looks like you are using a dynamic inventory for your AWS hosts, instead of 
having include_vars to point to the Windows vars file I would create a 
create an actual windows group in that inventory and add those hosts in 
there. In the end it would would look something similar to this (untested)

# inventory/hosts
[tag_OSType_Windows]
# keep empty, is populated in the dynamic inventory

[windows:children]
tag_OSType_Windows

# inventory/ec2.py
... keep as normal, just to show how to mix/match dynamic and static 
inventories

# inventory/ec2.ini
... keep as normal

# group_vars/windows.yml
ansible_user: username
ansible_password: "#####"
ansible_port: 5986
ansible_connection: winrm
ansible_winrm_scheme: https
# The following is necessary for Python 2.7.9+ when using default WinRM 
self-signed certificates:
ansible_winrm_server_cert_validation: ignore

# playbooks/windows.yml
- name: run test on Windows host
  hosts: '{{target}}'
  tasks:
  - win_stat:
      path: C:\Users
  
>From there you would add a tag to the newly created instances OSType: 
Windows so that when Ansible reads it from the inventory it is 
automatically put in the Windows group. Even though you are running the 
playbook on the one host it will inherit the group based on that tag which 
in turn get's the Windows vars required.

Thanks

Jordan

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/282f872e-cf0d-4da9-b0fd-5de17c879068%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to