Skip to content

Instantly share code, notes, and snippets.

@eyasuyuki
Last active October 26, 2020 03:09
Show Gist options
  • Select an option

  • Save eyasuyuki/d9c1dc96a9b8356164e5 to your computer and use it in GitHub Desktop.

Select an option

Save eyasuyuki/d9c1dc96a9b8356164e5 to your computer and use it in GitHub Desktop.
How to install Ansible to Windows

Requirements

  • Cygwin
  • gcc-core
  • openssh
  • python
  • python-setuptools

Install pip and Ansible

easy_install pip
pip install ansible

Troubleshooting

ssh error

If you encounter ssh error, put ansible.cfg to your script root.

ansible.cfg

[defaults]
inventory = ./hosts

[ssh_connection]
ssh_args = -o ControllMaster=no
@tailDASHeF

Copy link
Copy Markdown

You need to install python3-devel first. apt-cyg install python3-devel

To fix this

gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python3/python3-3.6.4-1.x86_64/build=/usr/src/debug/python3-3.6.4-1 -fdebug-prefix-map=/usr/src/ports/python3/python3-3.6.4-1.x86_64/src/Python-3.6.4=/usr/src/debug/python3-3.6.4-1 -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python3/python3-3.6.4-1.x86_64/build=/usr/src/debug/python3-3.6.4-1 -fdebug-prefix-map=/usr/src/ports/python3/python3-3.6.4-1.x86_64/src/Python-3.6.4=/usr/src/debug/python3-3.6.4-1 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.6m -c c/_cffi_backend.c -o build/temp.cygwin-2.11.2-x86_64-3.6/c/_cffi_backend.o
c/_cffi_backend.c:2:10: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment