Jira (PUP-9562) User resource does not respect forcelocal for the comment parameter

26 views
Skip to first unread message

Jarret Lavallee (JIRA)

unread,
Mar 14, 2019, 2:49:02 PM3/14/19
to puppe...@googlegroups.com
Jarret Lavallee created an issue
 
Puppet / Bug PUP-9562
User resource does not respect forcelocal for the comment parameter
Issue Type: Bug Bug
Affects Versions: PUP 5.5.10
Assignee: Unassigned
Components: Types and Providers
Created: 2019/03/14 11:48 AM
Environment:

Puppet 5.5.x with LDAP configured on EL 5.x

Priority: Minor Minor
Reporter: Jarret Lavallee

A user resource configured with forcelocal will still try to sync the comment with the external directory services. It does use the `lusermod` to modify the local `/etc/passwd` to the comment specified in the user resource, but it compares the `in_sync` with the external directory services, meaning that it always updates the comment on catalog compilation.

Reproduction:
1. Configure an agent with LDAP
2. Ensure nsswitch.conf has LDAP before `files` for `passwd`
3. Add a user to LDAP with a comment. Below is an example user.

testuser:*:510:10:test:/home/test:/bin/bash

4. Apply the following manifest on the agent multiple times and observe that it tries to update the comment every time.

user{'test':
  ensure => present,
  forcelocal => true,
  comment => 'local comment',
  uid => '510',
  gid => '10',
}

Expected Behavior:
The agent should check the local passwd file for the comment as per https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/user/useradd.rb#L58-L72

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (JIRA)

unread,
Oct 1, 2019, 12:15:03 AM10/1/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Team: Platform Core Night's Watch

Josh Cooper (JIRA)

unread,
Oct 1, 2019, 12:15:03 AM10/1/19
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Oct 1, 2019, 9:13:02 AM10/1/19
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Oct 2, 2019, 5:22:02 AM10/2/19
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Oct 2, 2019, 5:22:02 AM10/2/19
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: PR NW - Triage 2019-10-16

Gabriel Nagy (JIRA)

unread,
Oct 7, 2019, 6:53:04 AM10/7/19
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Oct 16, 2019, 4:24:11 AM10/16/19
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW - 2019-10-16 , NW - 2019-10-30

Mihai Buzgau (JIRA)

unread,
Oct 30, 2019, 5:00:13 AM10/30/19
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW - 2019-10-16, NW - 2019-10-30 , NW - 2019-11-13

Gabriel Nagy (JIRA)

unread,
Nov 4, 2019, 6:24:03 AM11/4/19
to puppe...@googlegroups.com
Gabriel Nagy updated an issue
Change By: Gabriel Nagy
Release Notes Summary: Prior to this fix, a user resource configured with forcelocal would still try to sync the comment with the external directory services, meaning that subsequent Puppet runs would not be idempotent.

To fix this, we compare the `in_sync` with the contents of the local `/etc/passwd` file.
Release Notes: Bug Fix

Ciprian Badescu (JIRA)

unread,
Nov 14, 2019, 10:08:04 AM11/14/19
to puppe...@googlegroups.com

Heston Hoffman (JIRA)

unread,
Nov 18, 2019, 12:23:04 PM11/18/19
to puppe...@googlegroups.com

Austin Boyd (JIRA)

unread,
Dec 12, 2019, 9:06:06 AM12/12/19
to puppe...@googlegroups.com
Austin Boyd updated an issue
Change By: Austin Boyd
Zendesk Ticket IDs: 34145
Zendesk Ticket Count: 1

Dorin Pleava (JIRA)

unread,
Jan 8, 2020, 7:12:03 AM1/8/20
to puppe...@googlegroups.com

Dorin Pleava (JIRA)

unread,
Jan 8, 2020, 9:55:03 AM1/8/20
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages