Install a Babun (Cygwin) Shell and Ansible for Windows
Update: You might find this thread useful if you have issues getting ansible to work in babun/cygwin - thanks mcfo for the comments. Update2: Another option is to run ansible inside a docker container using Docker for Windows. This way you are actually using Linux to run ansible in, so are likely to have less problems. Startup time, (after the first time you run it), should be very quick, so has none of the disadvantages of running inside a heavy VM. Babun is a nice distribution of cygwin with lots of pre-installed packages, and also a built in package manager called pact. It has an auto update tool, and includes most of the ansible requirements already, such as python and gcc. Another advantage is that it won’t affect your existing Cygwin install, should you already have one. As such, it’s a pretty good way to get started with ansible on a windows workstation. Note that this is not officially supported, but it is often needed, and works pretty well for the most part, with a few tweaks. This guide covers installing Babun, and the appropriate packages to get ansible working on Windows.
Install a Babun (Cygwin) Shell and Ansible for Windows - Comments
Old Article Comments
I exported these from my old wordpress blog, so they are a bit out of date, but I thought I’d keep them around for posterity.
[mat] - Thanks for sharing this !
mirzawaqasahmed - Hi Chris, Thanks for sharing this. However when i am running ansible-playbook it first gave me following error…
GATHERING FACTS \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 0 \[main\] python2.7 8168 child\_info\_fork::abort: address space needed by '\_speedups.dll' (0x6D0 000) is already occupied Traceback (most recent call last): File "/opt/ansible/bin/ansible-playbook", line 324, in sys.exit(main(sys.argv\[1:\])) File "/opt/ansible/bin/ansible-playbook", line 264, in main pb.run() File "/opt/ansible/lib/ansible/playbook/\_\_init\_\_.py", line 348, in run if not self.\_run\_play(play): File "/opt/ansible/lib/ansible/playbook/\_\_init\_\_.py", line 739, in \_run\_play self.\_do\_setup\_step(play) File "/opt/ansible/lib/ansible/playbook/\_\_init\_\_.py", line 629, in \_do\_setup\_step accelerate\_port=play.accelerate\_port, File "/opt/ansible/lib/ansible/runner/\_\_init\_\_.py", line 233, in \_\_init\_\_ cmd = subprocess.Popen(\['ssh','-o','ControlPersist'\], stdout=subprocess.PIPE, stderr=subprocess. PIPE) File "/usr/lib/python2.7/subprocess.py", line 710, in \_\_init\_\_ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1223, in \_execute\_child self.pid = os.fork() OSError: \[Errno 11\] Resource temporarily unavailable then after running the ansible-playbook command gain, its giving me the following error: GATHERING FACTS \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* fatal: \[default\] => private\_key\_file (/.ssh/ansible-windows-ssh-key) is group-readable or world-readable and thus insecure - you will probably get an SSH failure TASK: \[ensure ntpd is at the latest version\] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* FATAL: no hosts matched or all hosts have already failed -- aborting
ANY IDEA OF WHY IT IS HAPPENING. Thanks in advance Waqas
Ansible tutorial - part 1 - intro to Ansible - If you are using Windows, it’s a bit more hassle, unless you already have the Windows with Bash terminal! If you do, simply use APT for installing Ansible. However if you don’t have it yet, you need to install more things. On our Windows machines we use Babun (much better version of Cygwin, if you didn’t hear about it, check it out right now!). To install Ansible with Babun, please use this tutorial. […]
[mcfo] -
Thanks! Regarding right-click pasting into vim: Add the line set mouse-=a to your ~/.vimrc and it should work.
[Zoran] - I see the issue below: jinja2 is installed but seems to be unknown to ansible. Any suggestions? Thanks.