I started using puppet for managing our RHEL servers. At this point I try to setup the user management. We are running a NIS environment on our campus, so until now I added the line +testuser::::: to the /etc/passwd file which then received the user information over NIS. What I want to achieve is that I have a set of admin users (admin1, admin2 and admin3) which can log in to every machine and a set of users (user1, user2 and user3) which are different on every machines. At the end of the passwd file I need an entry line +::::::/sbin/nologin to have all users information available but grant no access to them.
So /etc/passwd on one machine would look like
+admin1::::::
+admin2::::::
+admin3::::::
+user1::::::
+user2::::::
+::::::/sbin/nologin
and on an other machine
+admin1::::::
+admin2::::::
+admin3::::::
+user1::::::
+user3::::::
+::::::/sbin/nologin
Because the admin users are rather static but the normal users vary from system to system, I thought to declare the admin users in a module and the normal users on a per node basis.
My first problem is, how to edit the /etc/passwd file to add the lines. Furthermore it's important that the sorting is correct, so that the nologin line is at the end. Do you have any idea how to achieve this in a flexible manner?
Thanks and regards