2

I am trying to install the Ansible open source automation platform on Windows. There are many guides out there for how to install Ansible using Cygwin (eg. 1, 2).

However, I already have Git-Bash installed on Windows 7 (from here).

Is it possible to install Ansible in Windows, inside Git-Bash.

EDIT:

UPDATE:

I had a lot of problems with Cygwin.

  1. I installed Cygwin.
  2. Then I did pip install PyYAML, jinja, paramiko, cryptography, etc. I wanted to install the Ansible dependencies first and then do pip install ansible only at the end. It did not install paramiko and cryptography successfully. Two packages libffi and ncurses were found to be missing. I re-ran the Cygwin installer and installed libffi. I could not find ncurses.
  3. I restarted Cygwin and re-tried pip install paramiko cryptography. They did not install again and gave the same error message that libffi and ncurses were missing. At that point, I gave up and uninstalled Cygwin. I did not try it again.

EDIT 2: To answer this question, I did this:

  • 2
    Git Bash is not a full Linux environment, it is specifically built to run Git on Windows, not a general purpose environment. For general purpose use an environment like Cygwin or the Windows Subsystem for Linux. – heavyd Oct 2 '17 at 22:06
  • 2
    While WSL is Linux shell it does have limitations and doesn’t support everything at this time. Git-Bash isn’t a Cygwin replacement nor is it advertised as one. – Ramhound Oct 2 '17 at 23:48
  • Thanks to both. Can't do it with Git-Bash.:( OK, my question is answered. – edesz Oct 3 '17 at 17:07
3

Git-Bash is insufficient to install ansible, it is lack of build tools.

I recommend you try msys2(which git-bash base on), once install all ansible build dependencies, you can install ansible just by pip install ansible.

  • Hey thanks! I will have to try this....it looks very interesting. – edesz Nov 2 '17 at 16:18
0

Working instructions are here: https://stackoverflow.com/questions/32596203/cygwin-how-to-install-ansible

Basically you install Cygwin and build tools, and available Python modules. Then you run:

pip2 install ansible
-2

I use Windows Subsystem for Linux and Ansible is working great there. You can quickly give it a try by enabling the feature via PowerShell script: Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux and then go to Microsoft Store and choose your distribution:

  • Ubuntu
  • OpenSUSE
  • SLES
  • Kali Linux
  • Debian GNU/Linux
  • 1
    Yup, good point that is yet another option for Windows 10. Here I was referring to Windows 7 specifically, which was my reason to try Cygwin (unsuccessfully) and gitbash (before going with the VM option), though the options for Windows 10 are certainly more convenient. – edesz Feb 12 at 17:20
  • I think you were downvoted because you gave a link-only answer. You need to copy the exact steps needed in to your answer. The reason is that the link may die and then your answer becomes blank. stackoverflow.com/help/how-to-answer – HackSlash Feb 12 at 18:27

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.