How can I implicitly specify a second set of access credentials? #3332
-
My problem is that I use Ansible playbooks, and I have two private repositories. The first one contains the playbooks, and the second one contains the roles. In the Semaphore template, I can easily specify access credentials for the first repository (with playbooks). However, when Semaphore tries to access the second repository through the requirements.yml file, it fails because it does not apply the private key associated with the first repository to the second one, nor does it try to find access credentials for the repository defined in the requirements.yml within the Key Store. Also, I can't pass variables like a PAT token in the repository URL before the playbook runs. I tried using the same SSH pair in 2 different repos, and I have a pair in a Key Store with 2nd repo and the same SSH PrivateKey. What should I do in this case? I certainly don't want to store plain-text PAT tokens in the requirements.yml. What am I missing? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I hope I understood your point and you can adopt some parts.
instead of git use your git backend, e.g. gitlab/github/whatever and e.g. in requirements.yml use this
via the hostname the correct key will be used. And in Semaphore you configure repos for inventory and playbooks with this URL |
Beta Was this translation helpful? Give feedback.
I hope I understood your point and you can adopt some parts.
In my setup I use three keys for three repositories (inventory,playbooks,roles). For this I use the ssh config, e.g.
instead of git use your git backend, e.g. gitlab/github/whatever
and e.g. in requirements.yml use this