Thursday, August 22, 2019

Ansible installation to support windows

sudo pip install markupsafe

sudo pip installxmltodict

sudo pip install pywinrm   --> python module allows to communicate with windows machines over winrm.

sudo pip install ansible


Need to configure windows winrm port for ansible port to communicate with the winodws hosts.
For testing, we are ignoring cert valiadtion for credentials.

#group_vars/winrm.yml
ansible_user: vagrant
ansible_password: vagrant
ansible_port: 5985
ansible_connection: winrm
ansible_winrm_cert_validation: ignore




 ansible web -i inventory.yml -m win_ping

To enable winrm on windows using powershell:


 Enable-PSRemoting -Force -SkipNetworkProfileCheck

Set-Item WSMan:\localhost\Client\TrustedHosts -Value "192.168.63.102" -Force


Reference

No comments:

Post a Comment