Skip to content

Instantly share code, notes, and snippets.

@filviu
Last active December 7, 2015 09:55
Show Gist options
  • Save filviu/20f8aca03b72069998b3 to your computer and use it in GitHub Desktop.
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.
@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