Replies: 3 comments 2 replies
-
Hi @SLedunois I'm sure it is problem with Semaphore behaviour - Semaphore overrides %HOME% env variable to a project directory. |
Beta Was this translation helpful? Give feedback.
-
Update: I tested a new approach using only environment variables.
with the script git-pass.sh that simply does:
It works perfectly in a bash template. |
Beta Was this translation helpful? Give feedback.
-
Ok, I found out why it’s not working. The environment variables don’t get propagated between the LocalJob preparation phase and the execution of the commands when installing the requirements. They are present here during the run preparation: semaphore/services/tasks/LocalJob.go Line 559 in c47e9d1 But the environment variables are never passed when installing the requirements: semaphore/services/tasks/LocalJob.go Line 665 in c47e9d1 And even less when running the ansible-galaxy commands: semaphore/db_lib/AnsiblePlaybook.go Line 40 in c47e9d1 So by design, variable groups are excluded from the preparation steps |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Hello,
I just installed Semaphore and I’m using roles/collections that are hosted on a private GitLab, which therefore requires authentication.
When running a task, ansible-galaxy tries to install the dependencies, but it seems the Git credentials are not taken into account.
After some research, I have:
.gitconfig
to point to the.git-credentials
:This works perfectly fine with the following Bash script:
However, it doesn’t work at all when running an Ansible playbook. I always end up with the following log:
Do you have any idea how to fix this, or is this a bug?
Thanks,
SLedunois
Related to
Ansible (task execution)
Beta Was this translation helpful? Give feedback.
All reactions