-
-
Notifications
You must be signed in to change notification settings - Fork 998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows / WinRM Support? #56
Comments
I believe I just ruled out vault issues by decrypting the one vault protected group_vars yml and creating a new playbook that doesn't leverage vault at all. |
I've identified the issue. Its partly due to my custom docker file and where it installs ansible, and partly due to the fact that runner.js has hard-coded environment variables. What do you think about doing a loop over the existing environment variables and adding them to runner? What I had to modify was PATH, so maybe make PATH what you've currently got it set as then append :$PATH As well as adding other ENV vars (I added PYTHONPATH) to the nodejs env for spawn? |
Hmm that should be configured in the ansible admin console and not when running. How are you running semaphore? I haven't tested semaphore on windows but its node.js / docker therefore I assumed it would be ok. The paths in runner.js expect a UNIX sort of system. |
Sorry, I could have been more clear. My ansible server / source is a docker linux system. The nodes I'm managing are Windows over winrm. Regardless, it wasn't windows / winrm related as I had initially thought. You mentioned ansible admin console is where ENV vars and PATH should be set, what url/uri would that be in Semaphore? (I probably just missed it). If you want to reproduce what I'm seeing, I attached my Dockerfile in the first post. You can remove all of the artifactory and openssl stuff thats specific to me just running in a corp environment. I'll poke around a bit more in semaphore and see if I can find what you're referring to and if not, fork and submit a PR and see what you think. Cheers, |
Right I was suggesting that if the ENV paths were to be configurable then it should be via the config in the web interface. See if changing the paths here: https://github.com/ansible-semaphore/semaphore/blob/master/lib/runner.js#L206 lead to anything. Locate the ansible-playbook binary and add it to the path. See if that works and ping back! :) Cheers, |
Yep, thats the issue. I've got ansible-playbook in my $PATH but runner.js sets a specific environment that doesn't take into account the existing environment. When I added my path to ansible on that line it works fine. Using that as a work-around, will see if I can submit a PR to pull in existing ENV when executing runner unless you can think of reasons you wouldn't want that to be default behavior. |
What is the path that you needed? It might be good to use that path while semaphore is running under your environment. |
What do you think about these for a PR? Essentially for the PATH, just prepend existing ENV PATH, and for PYTHONPATH, if it's not set, it shouldn't impact anything since you're not setting it in the runner.js already? Changes: |
prelegalwonder@199b82a looks ok. If you make a PR i can merge that straight away.. Thanks |
This is a workaround to use WinRM. |
I've been having issues similar to issue 23 except I get the bugsnag ENOENT when semaphore goes to execute the playbook.
I've tried running it with debug logs as well as strace but can't tell why I'm getting the spawn error on ansible-playbook.
I've confirmed that I can run the ansible-playbook command manually against the downloaded playbook. Git is installed and semaphore connects to git just fine and downloads the playbook.
I tried debugging the runner.js but I'm no whiz at javascript and I couldn't find anything out of place and I'm guessing it's either an issue with my vault key or the fact that I'm using winrm?
Here's the basic error -
I've attached more detailed logs (strace and node-debug) as well as my customized Dockerfile if you want to try and reproduce. I needed a later ansible to get some of the newer win_modules.
This is nodejs v0.12.9
semaphore_logs.zip
Dockerfile-sempahore.txt
The text was updated successfully, but these errors were encountered: