Trevor Vaughan
2007-Jan-30 20:08 UTC
Problem deleting user''s primary groups and the users themselves.
This has been a "fun" issue. Basically, I''m trying to purge (ensure => absent) useless users and groups that I don''t need. The problem that I''m having, is that I can''t seem to determine a way to make sure that the users are deleted before the groups. For example: user { games: ensure => absent } group { games: ensure => absent } Now, sometimes everything goes fine, but other times, I get the error: "Could not delete group games: Execution of ''/usr/sbin/groupdel games'' returned 2048: groupdel: cannot remove user''s primary group." I understand this and I''ve tried the following: user { games: ensure => absent, before => Group[games] } but it still isn''t working consistently. Any suggestions? Thanks, Trevor _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
Luke Kanies
2007-Jan-30 20:44 UTC
Re: Problem deleting user''s primary groups and the users themselves.
On Jan 30, 2007, at 2:08 PM, Trevor Vaughan wrote:> This has been a "fun" issue. > > Basically, I''m trying to purge (ensure => absent) useless users and > groups that I don''t need. > > The problem that I''m having, is that I can''t seem to determine a > way to make sure that the users are deleted before the groups. > > For example: > > user { games: ensure => absent } > group { games: ensure => absent } > > Now, sometimes everything goes fine, but other times, I get the error: > > "Could not delete group games: Execution of ''/usr/sbin/groupdel > games'' returned 2048: groupdel: cannot remove user''s primary group." > > I understand this and I''ve tried the following: > > user { games: ensure => absent, before => Group[games] } > > but it still isn''t working consistently. > > Any suggestions?This should now work fine in SVN, and I''d appreciate it if you could test it. The two changes I made are that explicit relationships now override automatic relationships (by default, the user will require the group, but if you instead specify that the group requires the user, Puppet will use that relationship instead), and you can now delete resources that have dependencies as long as those dependencies are themselves being deleted. I''ve tested this on Debian (which has the same restriction on removing primary groups) and it worked fine. The inconsistency you experienced is likely a result of the cyclic graph resulting from both your explicit dependency and the automatic dependency Puppet generated. Puppet will now also check whether the graphs are cyclic and attempts to point you to where the cycles are. I''ll be putting out a release with this fix as soon as I can get all of the tests passing again (I managed to break a few other tests during all of the past week''s bug-fixing), so it''d be great if you could verify this works for you before the release. -- The leader of Jamestown was "John Smith" (not his real name), under whose direction the colony engaged in a number of activities, primarily related to starving. -- Dave Barry, "Dave Barry Slept Here" --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Trevor Vaughan
2007-Jan-30 21:53 UTC
Re: Problem deleting user''s primary groups and the users themselves.
I''ll do my best to get to it. Thanks, Trevor On 1/30/07, Luke Kanies <luke@madstop.com> wrote:> > On Jan 30, 2007, at 2:08 PM, Trevor Vaughan wrote: > > > This has been a "fun" issue. > > > > Basically, I''m trying to purge (ensure => absent) useless users and > > groups that I don''t need. > > > > The problem that I''m having, is that I can''t seem to determine a > > way to make sure that the users are deleted before the groups. > > > > For example: > > > > user { games: ensure => absent } > > group { games: ensure => absent } > > > > Now, sometimes everything goes fine, but other times, I get the error: > > > > "Could not delete group games: Execution of ''/usr/sbin/groupdel > > games'' returned 2048: groupdel: cannot remove user''s primary group." > > > > I understand this and I''ve tried the following: > > > > user { games: ensure => absent, before => Group[games] } > > > > but it still isn''t working consistently. > > > > Any suggestions? > > This should now work fine in SVN, and I''d appreciate it if you could > test it. > > The two changes I made are that explicit relationships now override > automatic relationships (by default, the user will require the group, > but if you instead specify that the group requires the user, Puppet > will use that relationship instead), and you can now delete resources > that have dependencies as long as those dependencies are themselves > being deleted. > > I''ve tested this on Debian (which has the same restriction on > removing primary groups) and it worked fine. > > The inconsistency you experienced is likely a result of the cyclic > graph resulting from both your explicit dependency and the automatic > dependency Puppet generated. Puppet will now also check whether the > graphs are cyclic and attempts to point you to where the cycles are. > > I''ll be putting out a release with this fix as soon as I can get all > of the tests passing again (I managed to break a few other tests > during all of the past week''s bug-fixing), so it''d be great if you > could verify this works for you before the release. > > -- > The leader of Jamestown was "John Smith" (not his real name), under > whose direction the colony engaged in a number of activities, > primarily related to starving. -- Dave Barry, "Dave Barry Slept Here" > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >_______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users