# Different access credentials for devices using network\_cli

**URL:** <https://forum.ansible.com/t/different-access-credentials-for-devices-using-network-cli/32868>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [May 7, 2020, 2:16am UTC](https://forum.ansible.com/t/different-access-credentials-for-devices-using-network-cli/32868 "2020-05-07T02:16:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamroddo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iamroddo/32/321_2.png) [@iamroddo](https://forum.ansible.com/u/iamroddo)\
**Post date:** [May 7, 2020, 2:16am UTC](https://forum.ansible.com/t/different-access-credentials-for-devices-using-network-cli/32868/1 "2020-05-07T02:16:10Z")

</div>

It is possible to assign more than one credential to a job template, however there can be only one credential of any given type. According to [https://docs.ansible.com/ansible-tower/latest/html/userguide/credentials.html#machine](https://docs.ansible.com/ansible-tower/latest/html/userguide/credentials.html#machine), the credential type designated for network devices that use network\_cli should be “machine” which means that all network devices in the inventory that is used in a given job\_template must be accessible using a single machine credential. I’m looking for a solution (in AWX) to enable that devices, that have different username/password pairs, to be part of the same inventory, which seems to preclude using a machine credential. Would creating a custom credential which creates environment variables for each username and password value and then setting the ansible\_user and ansible\_password for particular hosts or groups from a lookup be a good solution?

Rod Oliver

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [May 7, 2020, 2:22am UTC](https://forum.ansible.com/t/different-access-credentials-for-devices-using-network-cli/32868/2 "2020-05-07T02:22:14Z")

</div>

You could use custom credentials type and supply vars on that one play from the custom credential type. So on that one play put in some vars for the connection and create a custom credential with the extra-vars you specified.

It may not sound clear now but can supply details later. Just thought I would let you know I believe it is possible. Will do some testing as I have some thing like this to as well.

---

<div class="post-metadata">

**Author:** ![iamroddo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iamroddo/32/321_2.png) [@iamroddo](https://forum.ansible.com/u/iamroddo)\
**Post date:** [May 7, 2020, 7:49am UTC](https://forum.ansible.com/t/different-access-credentials-for-devices-using-network-cli/32868/3 "2020-05-07T07:49:02Z")

</div>

Hi Wei-Yen,

I tested just tested it out. It works.

Best regards

Rod
