[PUP-3784] Puppet raises error when trying to apply user resources under FreeBSD Created: 2014/12/19  Updated: 2015/01/07  Resolved: 2015/01/07

Status: Closed
Project: Puppet
Component/s: Types and Providers
Affects Version/s: PUP 3.6.2
Fix Version/s: None

Type: Bug Priority: Normal
Reporter: Joe Eig Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: freebsd
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

FreeBSD, Ruby 2.0.0p598


Template:

 Description   

Apologies if i filed this issue under the wrong project. I have been working on a problem that could be an issue with "pw" under FreeBSD.

Puppet manages about 100 user resources and since two weeks some (not all) of my FreeBSDs silently started to raise errors with some (not all) of these resources.

Every resource has exactly the same structure:

define myusers($username, $comment, $password, $id, $ensure) {
  user { $username:
    comment => $comment,
    password => $password,
    uid => $id,
    gid => $id,
    managehome => true,
    ensure => $ensure,
  }
}
 
class user::joe {
  myuser { "joe":
    username => "joe",
    comment => "Joe Eig",
    password => 'blabla',
    id => 1100,
    ensure => present,
  }
}

The result is:

Error: Could not create user joe: Execution of '/usr/sbin/pw useradd joe -d /home/joe -u 1100 -g 1100 -c Joe Eig -m' returned 74: pw: user 'joe' already exists
Error: /Stage[main]/User::Joe/myuser[joe]/User[joe]/ensure: change from absent to present failed: Could not create user joe: Execution of '/usr/sbin/pw useradd joe -d /home/joe -u 1100 -g 1100 -c Joe Eig -m' returned 74: pw: user 'joe' already exists



 Comments   
Comment by Kylo Ginsberg [ 2014/12/19 ]

/cc Jasper Lievisse Adriaanse who does a ton of work with puppet on FreeBSD.

Comment by Jasper Lievisse Adriaanse [ 2014/12/19 ]

Hi,

I actually do a ton of Puppet on OpenBSD and have never worked with the pw user provider.

Having said that, does `puppet resource user joe` return anything for you?

Comment by Joe Eig [ 2015/01/07 ]

Hi,

thank you for your response and a happy new year!
After one week without doing anything with Puppet, I started the Puppet agents on my servers again und now it seems to work without problems. Same software versions, same manifests, same environment... If the problem occurs again, I will reopen this ticket.

Regards
Joe

Generated at Sat Sep 26 15:48:13 PDT 2020 using Jira 8.5.2#805002-sha1:a66f9354b9e12ac788984e5d84669c903a370049.