title: Ansible WinRM: Bails out with "[Errno 111] Connection refused"
body: <p>When i try to connect to my windows host via WinRM module i get execption "Connection refused" in Ansible.</p>
  
  <p>There is structure of ansible direcory:</p>
  
  <p><strong>Command:</strong></p>
  
  <pre><code>user@ansible:~/git/ansible-test$ ansible-playbook test.yml -i inventories/hosts 
  
  PLAY [install vm] ***************************************************************************************************************************************************************************
  
  TASK [Gathering Facts] ***********************************************************************************************************************************************************************
  fatal: [10.10.10.10]: UNREACHABLE! =&gt; {"changed": false, "msg": "ssl: HTTPSConnectionPool(host='10.10.10.10', port=5986): Max retries exceeded with url: /wsman (Caused by NewConnectionError('&lt;urllib3.connection.VerifiedHTTPSConnection object at 0x7f6298184d50&gt;: Failed to establish a new connection: [Errno 111] Connection refused',))", "unreachable": true}
          to retry, use: --limit @/home/user/git/ansible-test/test.retry
  
  PLAY RECAP ***********************************************************************************************************************************************************************************
  10.10.10.10               : ok=0    changed=0    unreachable=1    failed=0   
  </code></pre>
  
  <p><strong>ansible-test direcroty hierarchy:</strong></p>
  
  <pre><code>ansible-test$ tree
  .
  ├── group_vars
  │   └── all
  ├── inventories
  │   └── hosts
  └── test.yml
  
  2 directories, 3 files
  </code></pre>
  
  <p><strong>test.yaml:</strong></p>
  
  <pre><code>- name: test
    hosts: vm
    tasks:
      - name: get ipconfig information
        raw: ipconfg
        register: ipconfig_out
      - name: print stdout
        debug: var=ipconfig_out.stdout_lines
  </code></pre>
  
  <p><strong>inventories/hosts</strong></p>
  
  <pre><code>[vm]
  10.10.10.10
  </code></pre>
  
  <p><strong>group_vars/all</strong></p>
  
  <pre><code>ansible_connection: winrm
  ansible_user: Administrator
  ansible_password: password
  </code></pre>
  
  <p>But if i connect via WinRM from other windows host to the target 10.10.10.10:</p>
  
  <pre><code> Set-Item wsman:\localhost\Client\TrustedHosts -value 10.10.10.10
   Enter-PSSession -ComputerName 10.10.10.10 -Credential (Get-Credential -UserName Administrator)
  </code></pre>
  
  <p>everything is ok!</p>
  
  <p>What i do wrong in Ansible?</p>
  
  <p>P.S.
  Target host is Windows Server 2012</p>