Last active
May 21, 2024 02:10
-
-
Save maurizi/325387aee9ea94fbf903 to your computer and use it in GitHub Desktop.
Running Ansible on Windows
This file contains hidden or 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 | |
cygwin-shim.bat /bin/ansible-galaxy %* |
This file contains hidden or 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 | |
cygwin-shim.bat /bin/ansible-playbook %* |
This file contains hidden or 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 COMMAND=%1 | |
REM If you used the standard Cygwin installer this will be C:\cygwin | |
set CYGWIN=%USERPROFILE%\.babun\cygwin | |
REM You can switch this to work with bash with %CYGWIN%\bin\bash.exe | |
set SH=%CYGWIN%\bin\zsh.exe | |
if not exist "%SH%" ( | |
echo cygwin's sh.exe not found. Did you delete %CYGWIN% ? | |
exit /b 255 | |
) | |
"%SH%" -c "[[ -x "%COMMAND%" ]]" | |
if not errorlevel 0 ( | |
echo %COMMAND% not found. Did you uninstall it ? | |
exit /b 255 | |
) | |
"%SH%" -c "%*" |
where should i place the ansible-playbook.bat file?
FWIW, I use this sort of command since I want to mimic logging in.
c:\cygwin64\bin\bash.exe -l -c "echo 'the above is from my login script'"
JAVA_HOME is C:\Java\jdk1.8.0_241
the above is from my login script
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem of repeated project root path with ansible/vars/app with ansible-playbook.bat
Copied ansible-playbook.bat from
http://www.azavea.com/blogs/labs/2014/10/running-vagrant-with-ansible-provisioning-on-windows/
I got the following command expression, it's executable with vagrant/Windows/babun:
The error above seems that in the path for ansible/vars/app the path for my project
d:/yushen/dev/clojure/cas-reports
was repeated in front of it as/cygdrive/d/yushen/dev/clojure/cas-reports
(typical cygwin expression!)I examed the
ansible/provision.yml
but could not find any clue. Please help to give me some pointer. Thanks,Here is the content of
ansible/provision.yml
portion related to app: