Ansible - Add Host Windows

Run the Powershell below on Windows nodes to enable WinRM:

Run the Powershell above on Windows nodes remotely via psexec to enable WinRM:

psexec \\myserver -accepteula -nobanner -s -u DOMAIN\Administrator powershell -ExecutionPolicy Bypass -Command "iwr -UseBasicParsing | iex"

Configuration at server end to allow AD authentication:

cat > /etc/ansible/hosts << EOF
cat > /etc/ansible/group_vars/windows.yml << EOF
ansible_user: xxx
ansible_password: xxx
ansible_port: 5986
ansible_winrm_server_cert_validation: ignore
ansible_connection: winrm
ansible_winrm_transport: basic