lib/chef/provider/user/dscl.rb
#
# Removes the user from the system after removing user from his groups
# and deleting home directory if needed.
#
Removes the user from the system after removing user from his groups
and deleting home directory if needed.
Removes the user from the system after removing user from his groups and deleting home directory if needed .
def remove_user
          if @new_resource.supports[:manage_home]
            FileUtils.rm_rf(@current_resource.home)
          end
          run_dscl("list /Groups").each_line do |group|
            if member_of_group?(group.chomp)
              run_dscl("delete /Groups/#{group.chomp} GroupMembership '#{@new_resource.username}'")
            end
          end
          run_dscl("delete /Users/#{@new_resource.username}")
        end
def remove_user if @new_resource . supports [ :manage_home ] FileUtils . rm_rf ( @current_resource . home ) end run_dscl ( "list /Groups" ) . each_line do | group | if member_of_group? ( group . chomp ) run_dscl ( "delete /Groups/#{group.chomp} GroupMembership '#{@new_resource.username}'" ) end end run_dscl ( "delete /Users/#{@new_resource.username}" ) end
Removes the user from the system after removing user from his groups
and deleting home directory if needed.
Removes the user from the system after removing user from his groups and deleting home directory if needed .
# Remove home directory # Remove the user from its groups # Remove user account