# multiple inventories with different credentials

**URL:** <https://forum.ansible.com/t/multiple-inventories-with-different-credentials/32025>\
**Category:** AWX Project\
**Created:** [January 22, 2020, 3:57pm UTC](https://forum.ansible.com/t/multiple-inventories-with-different-credentials/32025 "2020-01-22T15:57:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spiro\_Mitsialis](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@Spiro\_Mitsialis](https://forum.ansible.com/u/Spiro_Mitsialis)\
**Post date:** [January 22, 2020, 3:57pm UTC](https://forum.ansible.com/t/multiple-inventories-with-different-credentials/32025/1 "2020-01-22T15:57:04Z")

</div>

In Ansible CLI, I can have one inventory file with 2 groups, routers and switches. Each group has its own credentials. Then I have a playbook that is running on switches, but also needs to execute a command on routers. I use the delegate\_to command. This works fine in cli but how can I get it to work in Tower? In tower I can create 2 inventories, each with its own credential profile. I can put them into one inventory and use groups as well but how do I add both credentials?

In a job template, I can only choose one inventory and one credentials profile.

---

<div class="post-metadata">

**Author:** ![Joffrey](https://avatars.discourse-cdn.com/v4/letter/j/4491bb/32.png) [@Joffrey](https://forum.ansible.com/u/Joffrey)\
**Post date:** [January 28, 2020, 10:51am UTC](https://forum.ansible.com/t/multiple-inventories-with-different-credentials/32025/2 "2020-01-28T10:51:03Z")

</div>

Hi,

You can set ansible\_user and ansible\_password in groups or hosts vars.Encrypt all passwords with vault and use the vault credential in your job template
