0
votes

I am trying to orchestrate server with LEMP stack and other configuration. For this I'm using vagrant to up(manage) servers and Ansible for auto configuration and package installations. I'm using windows as host machine where ansible need to be installed and all *Nix machine would be guest which are going to be configured.

With pip I have successfully installed ansible in C:\Python27\Scripts

I am facing Problem in running ansible and ansible-playbook on windows. If any one has done this for windows machine, Please share article or way to accomplish.

http://www.azavea.com/blogs/labs/2014/10/running-vagrant-with-ansible-provisioning-on-windows/

I had gone through above article but its not working, Error

==> default: Running provisioner: ansible...

zsh:1: no such file or directory: /bin/ansible-playbook

Ansible failed to complete successfully. Any error output should be visible above. Please fix these errors and try again.


In *Nix as guest all working excellent. But looking for support to do same in windows machine.

3

3 Answers

0
votes

Using windows as the control machine is not supported. But you can have a pleasant experience using docker with boot2docker.

This will install a virtualbox VM guest on the windows machine, which you will be able to use to configure you vagrant boxes, for which you will have to configure the networking properly.

0
votes

You can achieve this with cygwin. For scripts to do this have a look at: https://github.com/taliesins/win-ansible

As an added bonus it adds the shims required to use Ansible from windows command prompt and from Vagrant.

0
votes

From the documentation:

Currently Ansible can be run from any machine with Python 2 (version 2.7) or Python 3 (versions 3.5 and higher) installed. Windows isn’t supported for the control machine.

Generally speaking, if you are using a Windows host, you have 3 options. Listed in order of (my) preference:

  1. Run Ansible from a Docker container
  2. Run Ansible from WSL (if you're running on Windows 10). This Gist can help you with some further setup so that you don't have to invoke WSL to run Ansible.
  3. Run Ansible from Cygwin