This post will demonstrate how to setup an Ansible control machine on a Windows 10 box leveraging a Ubuntu Vagrant image.
Why might you want to do this?
- Supported Ansible development environment, per Ansible “Windows isn’t supported for the Ansible control machine.”
- Sync playbooks between Ubuntu Vagrant image and Windows 10 machine via Vagrant synced folders.
- Use tools installed on Windows 10 machine like Git, Sublime Text, etc. without requiring tools on Ansible control machine.
On Windows 10 machine, do the following:
cd ansible vagrant init ubuntu/xenial64 vagrant up
Now inside the Vagrant image, do the following:
sudo apt-get update sudo apt-get install software-properties-common sudo apt-add-repository ppa:ansible/ansible sudo apt-get update sudo apt-get install ansible
sudo apt-get install tree
Setup complete. Let’s Verify…
To recap, the “shared folder” that can be used to sync Ansible playbooks between Windows 10 and Ubuntu Vagrant image:
- Ubuntu Vagrant image acting as Ansible control machine, share path is: “/vagrant/share“
- Windows 10 box, share path is: “C:\HashiCorp\Vagrant\ansible\share“
Sample screenshot showing files/directories created within Ubuntu Vagrant image were synced to Windows 10 box: