Hello,
I have a server where I need to pip install
requirements from two separate github instances with two separate deploy keys (github doesn’t allow having the same deploy key for two different repositories). This is easy enough to do by creating an ssh config file for the user running the install:
Host project1 github.com
Hostname github.com
Identityfile /home/project_user/.ssh/id_rsa_project1
Host project2 github.com
Hostname github.com
Identityfile /home/project_user/.ssh/id_rsa_project2
Then I set the hosts respectively in my requirements.txt (e.g., git+ssh://git@project1/github-user/some_project.git#egg=some_project). This works perfectly when running pip install
as the project user on the server.
However, when doing this via ansible and ‘become_user’, it ignores the user’s .ssh/config file and it fails. How would I configure ansible to use two separate keys for a pip install?
Thanks in advance!