# host file doesn't read variable for windows

**URL:** <https://forum.ansible.com/t/host-file-doesnt-read-variable-for-windows/33477>\
**Category:** Ansible Project\
**Tags:** windows, ubuntu\
**Created:** [July 23, 2020, 11:59pm UTC](https://forum.ansible.com/t/host-file-doesnt-read-variable-for-windows/33477 "2020-07-23T23:59:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Work\_Email](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@Work\_Email](https://forum.ansible.com/u/Work_Email)\
**Post date:** [July 23, 2020, 11:59pm UTC](https://forum.ansible.com/t/host-file-doesnt-read-variable-for-windows/33477/1 "2020-07-23T23:59:42Z")

</div>

Hello,  
my host file for ansible is not reading additional variables. Following is my **host file:**

[ubuntu]

[amazonlinux2]

[database]

[windows]

[windows:vars]  
ansible\_connection = winrm  
ansible\_ssh\_port = 5986  
ansible\_winrm\_transport = kerberos  
ansible\_winrm\_server\_cert\_validation = ignore  
validate\_certs = false

**playbook:**

- hosts: windows\_server  
vars:  
ansible\_connection: winrm  
ansible\_ssh\_port: 5986  
anisble\_winrm\_transport: kerberos  
ansible\_winrm\_server\_cert\_validation: ignore  
validate\_certs: false  
ansible\_winrm\_scheme: https  
ansibe\_winrm\_read\_timeout\_sec: 30  
ignore\_unreachable: true  
gather\_facts: false

**If I add [windows\_server] call it back the playbook, it won’t read it for some reason and throws out the following error:**

\<[test.domain.com](http://test.domain.com)\> ESTABLISH WINRM CONNECTION FOR USER: None on PORT 5986 TO [test.domain.com](http://test.domain.com)  
fatal: [[test.domain.com](http://test.domain.com)]: UNREACHABLE! =\> {  
“changed”: false,  
“msg”: “ssl: auth method ssl requires a username”,  
“unreachable”: true

It’s using Kerberos authentication where it works for other playbooks. I double-checked by entering -klist and ticket are there.

**Any idea why it won’t work?**

Thanks,  
Jimmy

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [July 24, 2020, 5:41am UTC](https://forum.ansible.com/t/host-file-doesnt-read-variable-for-windows/33477/2 "2020-07-24T05:41:50Z")

</div>

1. You have a typo when you specify kerberos auth, it should be ‘ansible\_winrm\_transport’ but you have ‘anisble\_winrm\_transport’
2. validate\_certs: false doesn’t affect WinRM cert validation, that’s just a standard var
3. You shouldn’t have to set ansible\_winrm\_read\_timeout\_sec at all, it’s rarely ever needed
4. You are saying to run on windows\_server, based on your hosts file it’s not part of any groups, the windows group doesn’t have a member anyway so those vars won’t apply
