# Access to different gateways by using a list of passwords.

**URL:** <https://forum.ansible.com/t/access-to-different-gateways-by-using-a-list-of-passwords/37400>\
**Category:** Ansible Project\
**Created:** [November 30, 2022, 11:15am UTC](https://forum.ansible.com/t/access-to-different-gateways-by-using-a-list-of-passwords/37400 "2022-11-30T11:15:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niyazi\_Gokberg\_Gundu](https://avatars.discourse-cdn.com/v4/letter/n/85f322/32.png) [@Niyazi\_Gokberg\_Gundu](https://forum.ansible.com/u/Niyazi_Gokberg_Gundu)\
**Post date:** [November 30, 2022, 11:15am UTC](https://forum.ansible.com/t/access-to-different-gateways-by-using-a-list-of-passwords/37400/1 "2022-11-30T11:15:30Z")

</div>

Hi, I have over 300 gateways which I need to connect by using passwords which is a list of couple different passwords for the first time, then I will deploy the ssh keys. To connect those gateways, I need to loop over a list of vaulted passwords on each gateway. Any idea how to do that?  
Thanks in advance.  
Berk

---

<div class="post-metadata">

**Author:** ![Walter\_Rowe](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/walter_rowe/32/4506_2.png) [@Walter\_Rowe](https://forum.ansible.com/u/Walter_Rowe)\
**Post date:** [November 30, 2022, 11:22am UTC](https://forum.ansible.com/t/access-to-different-gateways-by-using-a-list-of-passwords/37400/2 "2022-11-30T11:22:16Z")

</div>

Perhaps use a filter to create a combined JSON list of inventory and passwords that ends up with something like this:

{ machine: machineA, password: password1 },

{ machine: machineA, password: password2 },

{ machine: machineA, password: password3 },

{ machine: machineB, password: password1 },

{ machine: machineB, password: password2 },

{ machine: machineB, password: password3 },

{ machine: machineC, password: password1 },

{ machine: machineC, password: password2 },

{ machine: machineC, password: password3 }

You would then loop through this and use item.machine / item.password?

Walter

---

<div class="post-metadata">

**Author:** ![Niyazi\_Gokberg\_Gundu](https://avatars.discourse-cdn.com/v4/letter/n/85f322/32.png) [@Niyazi\_Gokberg\_Gundu](https://forum.ansible.com/u/Niyazi_Gokberg_Gundu)\
**Post date:** [November 30, 2022, 11:29am UTC](https://forum.ansible.com/t/access-to-different-gateways-by-using-a-list-of-passwords/37400/3 "2022-11-30T11:29:44Z")

</div>

thanks for the quick response Walter, I will try that, and I think I can also register that correct passwords for each gateway in this case. Thanks!  
best.
