Configure Ansible Windows Host

Tech Stack

  • Ansible

  • Windows Server

Common Problems

  • Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED], Solution: Add ansible_winrm_server_cert_validation=ignore to host variable.

Setting WinRM

Download script for Powershell from

PS C:\Users\Administrator\Downloads> .\ConfigureRemotingForAnsible.ps1

Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your
computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning
message. Do you want to run C:\Users\Administrator\Downloads\ConfigureRemotingForAnsible.ps1?
[D] Do not run  [R] Run once  [S] Suspend  [?] Help (default is "D"): R
Self-signed SSL certificate generated; thumbprint: A1C3695B41141B177513C4E1C14ED48C8529C927

wxf                 :
a                   :
w                   :
lang                : en-US
Address             :
ReferenceParameters : ReferenceParameters


Install Pywinrm

$ pip install pywinrm

Setting Inventory or Ansible Host



Test Connection

$ ansible win -m win_ping | SUCCESS => {
    "changed": false,
    "ping": "pong"