Note: This assumes you already have Bash on Ubuntu on Windows enabled.
Preface
In most Ansible test/dev guides I have seen, creating a linux distro VM as your control server is a standard part of the process for people who have a Windows workstation. This doesn’t have to be the case if you are running Windows 10.
This is not meant for production use.
Happy Test/Dev-ing!
Installing Ansible 2.2+
This will update all of your packages, add the ansible PPA repository, and install ansible
You should see something like this:
Additional Requirements for Managing Windows Nodes
You may skip this if you are not managing Windows nodes.
That’s it!
You’ve officially installed Ansible 2.2+ on Windows.
Quick Test
Add your host to the default hosts file.
I happened to have a Vagrant Windows test box. To test that Ansible is working I did this:
Run:
Add:
[windows]
192.168.57.3
Save and quit (:wq)
Set Up Group_Vars
Run:
Add:
ansible_user: vagrant
ansible_password: vagrant
ansible_port: 5985
ansible_connection: winrm
ansible_winrm_scheme: http
ansible_winrm_cert_validation: ignore
Test Connectivity
Run:
Successful Response:
192.168.57.3 | SUCCESS => {
"changed": false,
"ping": "pong"
}
Another Tool In The Box
I don’t know about anyone else, but I’m really beginning to enjoy the benefits of the Ubuntu subsystem on Windows. Being able to run Jekyll for GitHub Pages, and now having Ansible directly on my machine… It’s so. damn. awesome. Truly the best of both worlds at your fingertips. Keep it coming Microsoft!
Cheers everyone! Hope you’re having a happy start to your new year! Feel free to hit me up on twitter anytime.
-Joshua