# Hosts with multiple users.

**URL:** <https://forum.ansible.com/t/hosts-with-multiple-users/29662>\
**Category:** Ansible Project\
**Created:** [February 12, 2019, 7:14pm UTC](https://forum.ansible.com/t/hosts-with-multiple-users/29662 "2019-02-12T19:14:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eduardo\_Nunes\_Pereir](https://avatars.discourse-cdn.com/v4/letter/e/85e7bf/32.png) [@Eduardo\_Nunes\_Pereir](https://forum.ansible.com/u/Eduardo_Nunes_Pereir)\
**Post date:** [February 12, 2019, 7:14pm UTC](https://forum.ansible.com/t/hosts-with-multiple-users/29662/1 "2019-02-12T19:14:34Z")

</div>

Someone could help me with this case where I have multiple hosts and for these hosts I do not know which exact user but I have a list with some possible possible users. inside the hosts file I create the group: vars but I can only put a single user.

---

<div class="post-metadata">

**Author:** ![JonTheNiceGuy](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jontheniceguy/32/2267_2.png) [@JonTheNiceGuy](https://forum.ansible.com/u/JonTheNiceGuy)\
**Post date:** [February 12, 2019, 8:22pm UTC](https://forum.ansible.com/t/hosts-with-multiple-users/29662/2 "2019-02-12T20:22:46Z")

</div>

Hi Eduardo,

Ansible tends to be relatively prescriptive - you need to specify the username, or you’d need to specify multiple “host” entries with each of the usernames.

You could perform a “simple” action (like “ping” or “setup”) and let it stop processing hosts that it doesn’t get a response from? (Although, to be fair, I don’t entirely know how you’d do that).

Perhaps you’d be better off explaining what you’re trying to do?

---

<div class="post-metadata">

**Author:** ![Eduardo\_Nunes\_Pereir](https://avatars.discourse-cdn.com/v4/letter/e/85e7bf/32.png) [@Eduardo\_Nunes\_Pereir](https://forum.ansible.com/u/Eduardo_Nunes_Pereir)\
**Post date:** [February 12, 2019, 11:04pm UTC](https://forum.ansible.com/t/hosts-with-multiple-users/29662/3 "2019-02-12T23:04:43Z")

</div>

Hi Jons springs, Tks for Help.

As an example below is my playbook and inventory file, basically the playbook will be to back up the configuration of the equipment but the equipment is with different users, when playing the playbook the first user that corresponds to any of the equipment is set for the too much where in the execution will give error because the user does not correspond to next equiapemento of the inventory.

Playbook
