Issue #10354 has been updated by Bernard Nauwelaerts.

Target version set to 2.7.7

This problem occurs with Puppet 2.7.7 development version as well.

To reproduce it :

    ralsh user test2 ensure=present managehome=true allowdupe=false uid=10000 
&& ls -l /home
    ralsh --debug user test2 ensure=absent managehome=true allowdupe=false 
uid=10000 && ls -l /home


The second command output is : 

    debug: Failed to load library 'ldap' for feature 'ldap'
    debug: Puppet::Type::User::ProviderLdap: feature ldap is missing
    debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dscl 
does not exist
    debug: Puppet::Type::User::ProviderUser_role_add: file roleadd does not 
exist
    debug: Puppet::Type::User::ProviderPw: file pw does not exist
    debug: Loaded state in 0.00 seconds
    debug: User[test2](provider=useradd): Executing '/usr/sbin/userdel test2'
    notice: /User[test2]/ensure: removed
    debug: Finishing transaction -607483208
    debug: Storing state
    debug: Stored state in 0.00 seconds
    user { 'test2':
      ensure => 'absent',
    }

    total 20
    drwx------ 2 root  root  16384 Jan 26  2011 lost+found
    drwx------ 2 10000 10000  4096 Oct 28 15:20 test2


>From userdel manpage :

    -r, --remove
          Files in the user's home directory will be removed along with the 
home directory itself and the user's mail spool. Files located in other file 
systems will have to be searched for and deleted manually.
----------------------------------------
Bug #10354: Missing userdel flag in provider/useradd.rb when managehome is set 
to true
https://projects.puppetlabs.com/issues/10354

Author: Bernard Nauwelaerts
Status: Needs Decision
Priority: Normal
Assignee: Nigel Kersten
Category: user
Target version: 2.7.7
Affected Puppet version: 2.6.4
Keywords: userdel managehome
Branch: 


The documentation states about the managehome parameter : "The provider can 
create and remove home directories"

But when managehome=true and ensure=absent, the home directory remains on the 
target system because the -r flag is missing.

deletecmd is herited from objectadd.rb, so I solved this issue by overwriting 
it in useradd.rb. As I'm unfamiliar with ruby, there may be better ways to 
achieve this. Thanks.

  def deletecmd
    cmd = [command(:delete)]
        if @resource.managehome?
                cmd << "-r"
        end
    cmd << @resource[:name]
  end


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to