The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com
Support "-r" option to useradd (create a system user)
|Assignee:||Nigel Kersten||% Done:|
|Affected Puppet version:||0.24.8||Branch:||https://github.com/jamtur01/puppet/tree/tickets/2.6.x/2645|
Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com
This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.
Red Hat have added a -r option to useradd:
-r This flag is used to create a system account. That is, a user with a UID lower than the value of UID_MIN defined in /etc/login.defs and whose password does not expire. Note that useradd will not create a home directory for such an user, regardless of the default setting in /etc/login.defs. You have to specify -m option if you want a home directory for a system account to be created. This is an option added by Red Hat
I’d like to have support for this in puppet.
#5 Updated by Patrick Mohr almost 5 years ago
I’m having a related problem. On ubuntu, when I create a user, the home directory isn’t created. Is it likely that when this fix is done, the home directory will be created if the user isn’t a system user? If so, should the default be system user since that’s what user’s current meant for anyway?
I know the fix probably won’t get to me any time soon because I only use packages in ubuntu-stable. I plan to use exec “adduser $username”: as a workaround.
#6 Updated by Kenny Gryp over 4 years ago
We’re having issues as well. We’re forcing some userids (real persons), but for system users, we just define them in puppet without specifying a userid.
As workaround we now need a way to make sure the system users are created first or last, because our real users userid is have adjacent userids. Now when puppet mixes those, real users cannot be added because another user took that userid. One simple way I figured out already is adding a user with a very high uid, higher than the one’s we’ll be allocating, so that when a new uid is picked, it’s not conflicting.