# Using SSH config of 'become' user for pip installation

**URL:** <https://forum.ansible.com/t/using-ssh-config-of-become-user-for-pip-installation/22759>\
**Category:** Ansible Project\
**Created:** [October 10, 2016, 12:46pm UTC](https://forum.ansible.com/t/using-ssh-config-of-become-user-for-pip-installation/22759 "2016-10-10T12:46:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![j.leadbetter](https://avatars.discourse-cdn.com/v4/letter/j/839c29/32.png) [@j.leadbetter](https://forum.ansible.com/u/j.leadbetter)\
**Post date:** [October 10, 2016, 12:46pm UTC](https://forum.ansible.com/t/using-ssh-config-of-become-user-for-pip-installation/22759/1 "2016-10-10T12:46:38Z")

</div>

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](http://github.com)
> 
> Hostname [github.com](http://github.com)
> 
> Identityfile /home/project\_user/.ssh/id\_rsa\_project1
> 
> Host project2 [github.com](http://github.com)
> 
> Hostname [github.com](http://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!

---

<div class="post-metadata">

**Author:** ![alikins](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@alikins](https://forum.ansible.com/u/alikins)\
**Post date:** [October 12, 2016, 2:28pm UTC](https://forum.ansible.com/t/using-ssh-config-of-become-user-for-pip-installation/22759/2 "2016-10-12T14:28:59Z")

</div>

Using 'pip' module or 'shell' and a pip command line?

How does it fail (whats the ansible output include if used with '-vvv')?

Is both 'become\_user: youruser' and 'become: true' enabled? (ala  
[http://docs.ansible.com/ansible/become.html#directives](http://docs.ansible.com/ansible/become.html#directives))

Not sure how the pip module handles multiple Host/keys. Seems like it  
should work but I haven't tried to reproduce.

I'm assuming the ssh config with the Host stanzas is the standard  
.ssh/config in youruser home directory?

Is ssh agent forwarding being used?
