title: How do I use Ansible to manage Windows Servers?
body: <p>I'm trying to run an Ansible playbook against a Windows machine and I keep getting the error &quot;UNREACHABLE! =&gt; {&quot;changed&quot;: false, &quot;msg&quot;: &quot;basic: the specified credentials were rejected by the server&quot;, &quot;unreachable&quot;: true}&quot;</p>
  <p>I'm running the command from the Ansible server as: ansible-playbook updates2.yml -i 40.117.253.59,</p>
  <p>My playbook looks like this:</p>
  <pre><code>---
   - hosts: 40.117.253.59
     vars:
       ansible_user: user
       ansible_password: password
       ansible_connection: winrm
       ansible_winrm_transport: basic
       ansible_port: 5985
       ansible_winrm_server_cert_validation: ignore
     tasks:
     - name: Install all security updates with automatic reboots
       win_updates:
         category_names:
         - SecurityUpdates
         reboot: yes
  </code></pre>
  <p>I have verified that the username/password are correct, winrm is enabled on the target Windows machine and I've disabled the Windows firewall.  Any help would be greatly appreciated.</p>
  <p>Thanks in advance</p>