Jira (PUP-1913) Puppet user resource should respect the forcelocal option

7 views
Skip to first unread message

Bob Vincent (JIRA)

unread,
Nov 20, 2015, 12:20:15 PM11/20/15
to puppe...@googlegroups.com
Bob Vincent updated an issue
 
Puppet / New Feature PUP-1913
Puppet user resource should respect the forcelocal option
Change By: Bob Vincent
Summary: Puppet user resource should  read only from local databases  respect the forcelocal option
Currently, the puppet user type uses `getent` to get information about user resources.

The problem with this is that `getent` will also report information from LDAP and other remote user management services that are configured in nsswitch.conf,
 which are not actually managed by Puppet.

This can cause Puppet to think
  and will report that  a user  is in a local group, or  exists even when it does  not  exist *locally* (as an entry  in  /etc/passwd and/or  a  local group, when the opposite is true.  directory in /home/$username)

- This is especially problematic since we user the useradd suite of commands to actually manage the settings, which of course affect local users/groups only.  
-

Puppet  uses luseradd/etc in an LDAP environment, but should switch to useradd/etc when "forcelocal" is true.

Puppet
's user type should have some way of examining /modifying  only local users and groups , to check if something  when the forcelocal option  is  currently  true /present/etc .
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.12#64027-sha1:e3691cc)
Atlassian logo

Sean Millichamp (JIRA)

unread,
Nov 20, 2015, 2:54:04 PM11/20/15
to puppe...@googlegroups.com
Sean Millichamp commented on New Feature PUP-1913
 
Re: Puppet user resource should respect the forcelocal option

Unless I am misunderstanding something, user enumeration via the provider instances method (used by the resource type for purging, for example) is invoked at a point where the forcelocal option won't be seen/honored, even if set as a global resource default. So, focusing on forcelocal really misses a large part of this. The real fix needs to be in instances and how the users are enumerated.

Kylo Ginsberg (JIRA)

unread,
Mar 24, 2016, 12:45:04 PM3/24/16
to puppe...@googlegroups.com
Kylo Ginsberg updated an issue
 
Change By: Kylo Ginsberg
Scrum Team: Client Platform
This message was sent by Atlassian JIRA (v6.4.13#64028-sha1:b7939e9)
Atlassian logo

Kylo Ginsberg (JIRA)

unread,
Mar 24, 2016, 12:46:03 PM3/24/16
to puppe...@googlegroups.com
Kylo Ginsberg updated an issue
Change By: Kylo Ginsberg
Sprint: Client 2016-04-20 (Bigga Bugs)

Josh Cooper (JIRA)

unread,
Mar 30, 2016, 6:26:04 PM3/30/16
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Client 2016-04-20 (Bigga Bugs)

Agustin (JIRA)

unread,
Jul 5, 2016, 2:19:14 PM7/5/16
to puppe...@googlegroups.com
Agustin commented on New Feature PUP-1913
 
Re: Puppet user resource should respect the forcelocal option

I am seeing some strange behavior when using forge module kyleanderson/consul for instance.

I have authenticaion via pam with ldap. The module creates ok the local user, but when it runs again and all subsequent runs, take 60 more seconds than before. It used to take 4 secs the whole run, but as the consul module tries to eval the User consul, it seems it searches in my entire ldap and takes 60 seconds more. I put on my site.pp to default to User

{ forcelocal => true }

but no luck. It still wastes 60 seconds on User.

Package: 1.75
Last run: 1467731830
User: 51.14
Config retrieval: 6.60
Total: 61.44
Version:
Config: 1467731750
Puppet: 4.5.2

How can i help? Cheers!

Moses Mendoza (JIRA)

unread,
Sep 22, 2016, 3:32:06 PM9/22/16
to puppe...@googlegroups.com
Moses Mendoza updated an issue
 
Change By: Moses Mendoza
Labels: customer  manage-user-group  redmine
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Geoff Nichols (JIRA)

unread,
Mar 29, 2017, 2:30:04 PM3/29/17
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Mar 29, 2017, 2:32:02 PM3/29/17
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Apr 12, 2017, 12:21:03 PM4/12/17
to puppe...@googlegroups.com
Geoff Nichols updated an issue
Change By: Geoff Nichols
Sprint: Agent Grooming  On-Deck

Geoff Nichols (JIRA)

unread,
Apr 13, 2017, 1:40:03 AM4/13/17
to puppe...@googlegroups.com

John Duarte (JIRA)

unread,
May 15, 2017, 7:47:04 PM5/15/17
to puppe...@googlegroups.com
John Duarte updated an issue
Change By: John Duarte
Labels: customer manage-user-group redmine  triaged

Moses Mendoza (JIRA)

unread,
May 18, 2017, 1:49:18 PM5/18/17
to puppe...@googlegroups.com
Moses Mendoza updated an issue
Change By: Moses Mendoza
Labels: customer manage-user-group redmine  triaged

Halim Wijaya (JIRA)

unread,
Jan 11, 2018, 6:47:03 PM1/11/18
to puppe...@googlegroups.com
Halim Wijaya updated an issue
Change By: Halim Wijaya
CS Priority: Needs Priority
This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db)
Atlassian logo

Owen Rodabaugh (JIRA)

unread,
Jan 11, 2018, 7:20:04 PM1/11/18
to puppe...@googlegroups.com
Owen Rodabaugh commented on New Feature PUP-1913
 
Re: Puppet user resource should respect the forcelocal option

We reviewed this in CS Triage and have concerns on expanding the provider to handle forcelocal on OSs which do not offer the luseradd commands which forcelocal relies on. This would require the provider to manipulate the etc/shadow, etc/passwd, etc/user, etc/group which is very risky.

Forcelocal does work on distributions with the luser* commands. We've seen other cases(SLES pulling in an OpenSUSE package) where users were able to add the libuser package to get this to work.

Instead we would recommend updating the documentation to more clearly spell this out and also maybe elevating the debug message about forcelocal to warning level so that the reasons behind this not working are more clear.

Owen Rodabaugh (JIRA)

unread,
Jan 11, 2018, 7:55:04 PM1/11/18
to puppe...@googlegroups.com
Owen Rodabaugh updated an issue
 
Change By: Owen Rodabaugh
CS Priority: Needs Priority Reviewed

Adam Bottchen (JIRA)

unread,
Jan 23, 2018, 1:17:03 PM1/23/18
to puppe...@googlegroups.com
Adam Bottchen commented on New Feature PUP-1913
 
Re: Puppet user resource should respect the forcelocal option

Karthikeyan Kanagaraj The resource you outlined:

user { 'oracle': ensure => present, uid => '100000', gid => '1002', groups => 'dba', expiry => absent, allowdupe => true, home => '/app/oracle', forcelocal => true, shell => '/usr/bin/ksh', }

is instructing Puppet to add the oracle user to the supplementary group "dba" and to set an infinite expiration. Unfortunately the lusermod command does not support adding users to supplementary groups or setting account expiry dates, only useradd supports those commands. In order to update the user provider to handle those cases, we would need the OS supplied tools to support them.

Geoff Nichols (JIRA)

unread,
Apr 14, 2018, 9:06:05 PM4/14/18
to puppe...@googlegroups.com
Geoff Nichols updated an issue
 
Change By: Geoff Nichols
Labels: customer ldap manage-user-group redmine type_and_provider
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Stefan Förster (JIRA)

unread,
Apr 17, 2018, 3:20:03 AM4/17/18
to puppe...@googlegroups.com
Stefan Förster commented on New Feature PUP-1913
 
Re: Puppet user resource should respect the forcelocal option

With forcelocal => true adding a user with expiry => absent will not only trigger usage of the "wrong" commands, but also a usage error on CentOS 6:

Notice: /Stage[main]/Access/Access::Account[testuser]/File[/etc/ssh/authorized_keys.sftp.d/testuser]/ensure: defined content as '{md5}f67ab78e2b49dfcd6a5d4cc9b69749e8'
Debug: /Stage[main]/Access/Access::Account[testuser]/File[/etc/ssh/authorized_keys.sftp.d/testuser]: The container Access::Account[testuser] will propagate my refresh event
Debug: Executing: '/usr/sbin/luseradd -c F-I Fonddurchschau (bayn, production) -g sftp -d /home/testuser -p !! -s /sbin/nologin -u 18048 testuser'
Debug: Executing: '/usr/sbin/usermod -G testuser'
Debug: Executing: '/usr/sbin/lusermod -e testuser'
Error: Could not set expiry on user[testuser]: Execution of '/usr/sbin/lusermod -e testuser' returned 1: Error parsing arguments: unknown option.
Usage: lusermod [-imLU?] [-i|--interactive] [-c|--gecos STRING]
[-d|--directory STRING] [-m|--movedirectory] [-s|--shell STRING]
[-u|--uid NUM] [-g|--gid NUM] [-l|--login STRING]
[-P|--plainpassword STRING] [-p|--password STRING] [-L|--lock]
[-U|--unlock] [--commonname=STRING] [--givenname=STRING]
[--surname=STRING] [--roomnumber=STRING] [--telephonenumber=STRING]
[--homephone=STRING] [-?|--help] [--usage] [OPTION...] user
Error: /Stage[main]/Access/Access::Account[testuser]/User[testuser]/ensure: change from 'absent' to 'present' failed: Could not set expiry on user[testuser]: Execution of '/usr/sbin/lusermod -e testuser' returned 1: Error parsing arguments: unknown option.
Usage: lusermod [-imLU?] [-i|--interactive] [-c|--gecos STRING]
[-d|--directory STRING] [-m|--movedirectory] [-s|--shell STRING]
[-u|--uid NUM] [-g|--gid NUM] [-l|--login STRING]
[-P|--plainpassword STRING] [-p|--password STRING] [-L|--lock]
[-U|--unlock] [--commonname=STRING] [--givenname=STRING] 

Branan Riley (JIRA)

unread,
May 9, 2018, 2:55:03 PM5/9/18
to puppe...@googlegroups.com
Branan Riley updated an issue
 
Change By: Branan Riley
Labels: customer ldap manage-user-group redmine triaged type_and_provider user

Josh Cooper (Jira)

unread,
Mar 17, 2020, 12:45:04 PM3/17/20
to puppe...@googlegroups.com
Josh Cooper commented on New Feature PUP-1913
 
Re: Puppet user resource should respect the forcelocal option

Can this be closed now that PUP-8470, PUP-9195, PUP-10169 have been implemented?

This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
Apr 28, 2020, 12:15:03 PM4/28/20
to puppe...@googlegroups.com
Josh Cooper commented on New Feature PUP-1913

The functionality described in this ticket was implemented (see PUP-8470, PUP-9195, PUP-10169), so I'm closing this ticket. Please reopen if something is missing.

Josh Cooper (Jira)

unread,
May 13, 2020, 9:22:03 PM5/13/20
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages