Last active
December 7, 2015 09:55
-
-
Save filviu/20f8aca03b72069998b3 to your computer and use it in GitHub Desktop.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set CYGWIN=C:\usr\cygwin64 | |
set SH=%CYGWIN%\bin\bash.exe | |
"%SH%" -c "/usr/local/bin/ansible-winpath-playbook.sh %*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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