Bug #4379

Group provider for redhat: incorrect use of groupmod

Added by Sylvain Avril almost 2 years ago. Updated over 1 year ago.

Status:Closed Start date:07/27/2010
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:-
Target version:2.6.1
Affected Puppet version:2.6.0 Branch:
Keywords:Redhat, group
Votes: 0

Description

When using the following code with Redhat 5.4 and puppet 2.6.0, puppet use the groupmod with inexistant parameters for redhat :

group { "mygroup" :
    ensure => present,
    members => [ "myuser" ],
}

This is the error on puppet output : err: /Stage[main]/Was_base/Group[mygroup]/members: change from namepasswdgidmem to myuser failed: Could not set members on group[mygroup]: Execution of ‘/usr/sbin/groupmod -m myuser mygroup’ returned 2: /usr/sbin/groupmod: invalid option — m Usage: groupmod [-g gid [-o]] [-n name] group

A workaround could be to use usermod with all users: /usr/sbin/usermod -a -G mygroup myuser

4379_facter.txt - Facter output (2.5 kB) Sylvain Avril, 07/29/2010 12:04 pm

4379_puppet.txt - Puppet debug (14.3 kB) Sylvain Avril, 07/29/2010 12:04 pm

History

Updated by James Turnbull almost 2 years ago

  • Status changed from Unreviewed to Investigating
  • Target version set to 2.6.1

Updated by James Turnbull almost 2 years ago

  • Status changed from Investigating to Needs More Information

I can’t replicate this … can you post the output from facter and full logs with —debug —trace for the issue please?

Updated by Sylvain Avril almost 2 years ago

Here are the log.

I have recently updated puppet from 0.25.5 to 2.6. In previous version, this use case didn’t work (but wasn’t failing this way) because the managemembers capability was not present for Redhat.

Updated by James Turnbull almost 2 years ago

So manages_members is still not present for Red Hat in 2.6.0 – this hasn’t changed – I am cannot see where you can execute groupmod with -m in the codebase.

Updated by James Turnbull almost 2 years ago

Sorry – to continue – have you changed anything else?

Updated by Sylvain Avril almost 2 years ago

Previously with version 0.25.5, there was a warning a the begining of each puppet run stating that manages_members was not available. This is no longer the case with 2.6.

Probably the problem is the detection of manage_members ?

Updated by James Turnbull almost 2 years ago

But I still don’t see where this command is coming from – it does not exist in the code that I can see. Have you customised the provider in some way?

Updated by Sylvain Avril almost 2 years ago

I use the testing RPM from fedora (http://tmz.fedorapeople.org/repo/puppet/epel/5/) and I’ve not customized the provider. I’ve checked the ruby files on the server and the client and they are the same as in the master branch of the git repository. I’ve also reviewed the source of these files and, like you, I don’t see where this argument (-m) come from.

Updated by Jes Fraser almost 2 years ago

I can confirm the same issue on SLES 11, using a 2.6.0 RPM from http://download.opensuse.org/repositories/home:/eclipseagent:/puppet/SLE_11/x86_64/. I definitely haven’t changed the provider.

The appropriate section of class is:


user { "mule":
        name => "mule",
        uid => 105,
        gid => 105,
        ensure => present,
    }
    group { "mule":
        ensure   => present,
        gid      => 105,
        name     => "mule",
        members  => "mule"
    }

The error message I receive is:


info: Applying configuration version '1280965006'
err: /Stage[main]/Mule/Group[mule]/members: change from namepasswdgidmem to mule failed: Could not set members on group[mule]: Execution of '/usr/sbin/groupmod -m mule mule' returned 2: /usr/sbin/groupmod: invalid option -- 'm'
Try `groupmod --help' or `groupmod --usage' for more information.

Unfortunately I’m unable to access the systems right now – they’re on a customer internal network – but I could probably recreate the environment with SUSE in a VM if you needed more information. Sorry to be unable to be more detailed about it right now.

Updated by James Turnbull over 1 year ago

  • Target version changed from 2.6.1 to 2.6.2

Updated by James Turnbull over 1 year ago

  • Status changed from Needs More Information to Closed
  • Target version changed from 2.6.2 to 2.6.1

This is fixed in commit:9bdfe694bc6c60a48b45f8dd49c20c6da31445f7 in 2.6.x

Also available in: Atom PDF