DevOps Classroom Series – 23/May/2021

Ansible with Windows

  • Lets see how to make ansible work with windows servers
  • Ansible winRM protocol to establish connection with Windows Hosts
  • Ansible requires Powershell 3.0 or newer and atleast .net 4.0
  • Install ansible on the control node
  • Login into the Windows Node
  • Launch Powershell as Admin and try to execute the following steps
$url = "https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1"
$file = "$env:temp\ConfigureRemotingForAnsible.ps1"
(New-Object -TypeName System.Net.WebClient).DownloadFile($url,$file)

  • Now on the ansible control node install pywinrm
pip install pywinrm
  • Now created inventory as shown below and execute the win_ping

  • For working with windows server Refer Here for the windows modules

  • Refer Here for the sample playbook created to enable windows server

  • Refer Here for the corrected playbook

  • To Practice more on Ansible Deploy the following applications by writing ansible playbooks & roles

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Network Integration by Acurax Social Media Branding Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%