Comments (10)
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.
from semaphore.
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?
from semaphore.
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.
from semaphore.
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,
Andrew
from semaphore.
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,
Matej
from semaphore.
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.
from semaphore.
What is the path that you needed?
It might be good to use that path while semaphore is running under your environment.
from semaphore.
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:
pullGit - PATH
playTheBook - PATH and PYTHONPATH
from semaphore.
prelegalwonder@199b82a looks ok.
If you make a PR i can merge that straight away..
Thanks
from semaphore.
This is a workaround to use WinRM.
https://www.ansible.com/blog/connecting-to-a-windows-host
from semaphore.
Related Issues (20)
- Offline runners are not removed but are selected for task execution HOT 1
- Postgres connection bug - when using docker image semaphoreui/semaphore:2.9.37 HOT 1
- Error Cloning Repository when running task HOT 2
- Export project logs in syslog format HOT 6
- Live Logging of Jobs does not work behind Apache Reverse Proxy HOT 1
- Add ssh key error : 400 HOT 3
- Project backup 404 not found? HOT 5
- Unknown table 'semaphore.project__integration_extractor' after updating semaphore HOT 1
- Failed to connect to the host via ssh: No user exists for uid 1000 HOT 7
- Proposal: Integrate structured logging
- Proposal: Integrate Goth for external auth
- Proposal: Move alerts to UI
- Add support for inventories stored in a Git repository HOT 1
- MariaDB primary key HOT 5
- Feature request: add event trigger webhooks for external service integration
- Bug on templates import via API
- Restoring / creating project via API is not setting true for alerts HOT 1
- Refresh does not seem to work correctly
- Free concurrency mode HOT 4
- Task log view :: 24-hour time format
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from semaphore.