# Managing multiple users across server types.

**URL:** <https://forum.ansible.com/t/managing-multiple-users-across-server-types/13778>\
**Category:** Ansible Project\
**Created:** [October 26, 2013, 5:16pm UTC](https://forum.ansible.com/t/managing-multiple-users-across-server-types/13778 "2013-10-26T17:16:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deon\_Bredenhann](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@Deon\_Bredenhann](https://forum.ansible.com/u/Deon_Bredenhann)\
**Post date:** [October 26, 2013, 5:16pm UTC](https://forum.ansible.com/t/managing-multiple-users-across-server-types/13778/1 "2013-10-26T17:16:23Z")

</div>

Hi all

I’m just starting out with Ansible and reading through the docs.  
I’m doing a template project as I go along.  
[https://github.com/deonbredenhann/ansible\_template](https://github.com/deonbredenhann/ansible_template)

So now I need a playbook directory with my top level playbooks and underneath that the common directories with playbooks the can be included in the top level ones.

My question is, how do you solve the user problem. Users a, b, c, d can be created on the file servers. a and b can be created on the gateway.  
So I want to define all users only once and then included the list of users per server or group.

I hope this all makes sense. I can’t find any nice user recipes on the net that deals with users with different roles.

Thanks  
Deon

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 28, 2013, 12:26pm UTC](https://forum.ansible.com/t/managing-multiple-users-across-server-types/13778/2 "2013-10-28T12:26:05Z")

</div>

There’s plenty of ways you could do this, including making an array of what user name records you want per server and assigning that as a group/host variable, and then definining  
the definition of those users in a different data structure…

- user: name={{ [item.name](http://item.name) }} …  
when: user\_definition[[item.name](http://item.name)] in install\_users

with\_items: user\_definitions

Where ‘install\_users’ is a group variable and user\_definitions is an array of hashes as a group\_vars/all or is otherwise global.
