Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ansible wrappers to run widows vagrant from cygwin ansible. The .bat needs to be in the windows PATH and the .sh is needed to change the path vagrant passes to ansible to *nix style path.
@echo off
set CYGWIN=C:\usr\cygwin64
set SH=%CYGWIN%\bin\bash.exe
"%SH%" -c "/usr/local/bin/ansible-winpath-playbook.sh %*"
#!/bin/bash
PARAMS="$@"
# regex your user path to UNIX style path otherwise ansible fails
PARAMS_LINUX=${PARAMS/C:\/usr\/cygwin64\/home\/YOUR\.USER/\~}
echo "$PARAMS_LINUX"
ansible-playbook $PARAMS_LINUX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment