GithubHelp home page GithubHelp logo

Comments (10)

prelegalwonder avatar prelegalwonder commented on July 3, 2024

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.

prelegalwonder avatar prelegalwonder commented on July 3, 2024

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.

matejkramny avatar matejkramny commented on July 3, 2024

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.

prelegalwonder avatar prelegalwonder commented on July 3, 2024

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.

matejkramny avatar matejkramny commented on July 3, 2024

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.

prelegalwonder avatar prelegalwonder commented on July 3, 2024

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.

matejkramny avatar matejkramny commented on July 3, 2024

What is the path that you needed?

It might be good to use that path while semaphore is running under your environment.

from semaphore.

prelegalwonder avatar prelegalwonder commented on July 3, 2024

@matejkramny

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.

matejkramny avatar matejkramny commented on July 3, 2024

prelegalwonder@199b82a looks ok.

If you make a PR i can merge that straight away..

Thanks

from semaphore.

corystein avatar corystein commented on July 3, 2024

This is a workaround to use WinRM.

https://www.ansible.com/blog/connecting-to-a-windows-host

from semaphore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.