Puppet: System Administration Automated

Support

Ticket #1262 (closed defect: invalid)

Opened 7 months ago

Last modified 7 months ago

Non-existent user modification.

Reported by: apenney Assigned to: community
Priority: normal Milestone:
Component: Red Hat Version: 0.24.4
Severity: normal Keywords: user usermod useradd
Cc: Triage Stage: Unreviewed
Attached Patches: None Complexity: Unknown

Description

I have this statement:

    user { "tluker":
        ensure => "present",
        uid => 35417,
        gid => 100,
        groups => "wheel",
        comment => "Tivon Luker",
        home => "/home/tluker",
        shell => "/bin/bash",
        password => "$tluker",
        managehome => true,
        require => Package['ruby-shadow'],
    }

It seems like puppet failed to create the user, but considers it to already be managed so it keeps trying to use 'usermod' to change the password. Looking over the provider and type for user, there seems to be no actual test if the user exists on the machine, only tests to see if puppet believes it is managing it.

I think the correct fix is a test in the provider to make sure the user exists before usermod is called, and either error or call useradd if required to fix it.

Change History

05/23/08 19:46:26 changed by apenney

  • status changed from new to closed.
  • resolution set to invalid.

This is related to changes in useradd in RHEL 5.2. It now traverses LDAP and refuses to create local users if they exist in LDAP. There is a problem in that puppet cannot determine if a user exists in /etc/passwd before attempting to modify the password, but I'm closing this because the flaw is not really with puppet.