DevOps Classroom Series – 23/May/2021

Ansible with Windows

  • Lets see how to make ansible work with windows servers Preview
  • 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)

Preview Preview Preview

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

  • 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 Preview

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

Leave a Reply

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

About learningthoughtsadmin