Puppet module to manage groups not working

Solution 1:

Based on the documentation:

Manage groups. On most platforms this can only create groups. Group membership must be managed on individual users.

On some platforms such as OS X, group membership is managed as an attribute of the group, not the user record. Providers must have the feature ‘manages_members’ to manage the ‘members’ property of a group record

This is notoriously not working on Linux platforms that use groupadd/groupmod/groupdel to edit groups - see upstream issue #1298.

There is an alternative group provider by the Portland State University that can edit the group file.

Another option is to use Augeas to manage the group file.

Solution 2:

Default group providers in Puppet distribution don't include one able to manage group memberships. However, someone at Portland State University has required the same functionality and coded some custom provider(s). What you need from this is the file ggroupadd.pp which you'd like to put in /etc/puppet/modules/custom/lib/puppet/provider/group (adjust appropriately to reflect the location of your custom modules directory).

The new ggroupadd provider will manage groups so that whatever you put in member attribute will get into the file /etc/group as well.

Tags:

Puppet

Groups