Managing multiple users across server types.

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

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

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…

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.