# inventory file in jenkins server

**URL:** <https://forum.ansible.com/t/inventory-file-in-jenkins-server/22460>\
**Category:** Ansible Project\
**Created:** [September 2, 2016, 2:48am UTC](https://forum.ansible.com/t/inventory-file-in-jenkins-server/22460 "2016-09-02T02:48:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Edson\_Noboru\_Yamada](https://avatars.discourse-cdn.com/v4/letter/e/c68b51/32.png) [@Edson\_Noboru\_Yamada](https://forum.ansible.com/u/Edson_Noboru_Yamada)\
**Post date:** [September 2, 2016, 2:48am UTC](https://forum.ansible.com/t/inventory-file-in-jenkins-server/22460/1 "2016-09-02T02:48:31Z")

</div>

I have several hosts to manage and, in order to access them, i have to use a couple of different ssh keys (and I set the ansible\_ssh\_private\_key\_file in the inventory file to tell ansible which key to use).

The thing is that i’ve been maintaining 2 inventory files versions (which is a pain): one for my station (where ansible\_ssh\_private\_key\_file points to my home dir – /home/enyamada/.ssh) and other for jenkins server (with ansible\_ssh\_private\_key\_file pointing to /var/jenkins/.ssh files). Everything else is the same.

What’s the best way to circumvent this problem? (and keep a single version?)

Thank you!

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [September 2, 2016, 8:03am UTC](https://forum.ansible.com/t/inventory-file-in-jenkins-server/22460/2 "2016-09-02T08:03:32Z")

</div>

I guess /var/jenkins is the home directory for the Jenkins user, in that case you could use ~/.ssh or $HOME/.ssh

---

<div class="post-metadata">

**Author:** ![Edson\_Noboru\_Yamada](https://avatars.discourse-cdn.com/v4/letter/e/c68b51/32.png) [@Edson\_Noboru\_Yamada](https://forum.ansible.com/u/Edson_Noboru_Yamada)\
**Post date:** [September 2, 2016, 12:05pm UTC](https://forum.ansible.com/t/inventory-file-in-jenkins-server/22460/3 "2016-09-02T12:05:07Z")

</div>

Thank you, Kai, it worked.
