Hi,
Can’t find an answer to this.
The Ansible documents talk about “How do I handle different machines needing different user accounts or ports to log in with?”, and other things, but I can’t see how to address what we’re trying to do from the information and zillions of searches I’ve done on Google and this list.
I’m open to different ways of doing it, but ideally (I guess), I’d like to have a single file that lists all our hosts, and for each host, lists the login names (in addition to the “stock” login names) that should be on that machine. From that list, I’d like ansible to pull in the remaining user information to create the account (uid, primary gid, shell, comment, home directory, possibly a password), and then make sure the user’s account is on the machine.
I have gotten Ansible so that users common to all hosts are added. That works fine.
But how do I call the user module per host to have it add a list of additional users that are unique to that machine- ie. the users who have accounts on some machines and not others?
There is no grouping (eg. “web servers”) that this can be subsumed under in our environment.
This seems like a simple task but it isn’t obvious to me how to do it- at least not elegantly (especially in a way that’s dry).
Thanks in advance,
T N