Running Ansible commands from within Windows is unsupported at the time of this writing. However, windows users can setup Ansible with Cygwin.
Here are steps to getting Ansible (and it's related commands, like ansible-playbook) running on Windows: Download and install Cygwin, with at least the following packages selected (you can select the packages during the install process):
If you are working behind a proxy (as is the case in many corporate networks), edit the .bash_profile used by Cygwin either using vim (open Cygwin and enter vim .bash_profile), or with whatever editor you'd like, and add in lines like the following:
export http_proxy=http://username:password@proxy-address-here:80/ export https_proxy=https://username:password@proxy-address-here:80/
Download and install separately PyYAML and Jinja2 separately, as they‘re not available via Cygwin’s installer:
curl -O https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.10.tar.gz
curl -O https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.6.tar.gz
tar -xvf PyYAML-3.10.tar.gz && tar -xvf Jinja2-2.6.tar.gz
python setup.py install
to install each package.ssh-keygen
then hit enter to skip adding a password until you get back to the command prompt.git clone https://github.com/ansible/ansible /opt/ansible
# Ansible Settings ANSIBLE=/opt/ansible export PATH=$PATH:$ANSIBLE/bin export PYTHONPATH=$ANSBILE/lib export ANSIBLE_LIBRARY=$ANSIBLE/library
ansible --version
displays the ansible version.Pip does not work by default on Cygwin. Please follow these steps to enable pip:
python -m ensure pip