Skip to content

(#11046) improve freebsd user and group providers #338

Merged
merged 4 commits into from Jan 18, 2012

3 participants

@pcarlisle

Add password support to FreeBSD and enhance the pw user and group providers.

tdb added some commits Nov 18, 2011
@tdb tdb (#11318) Add password management on FreeBSD
This adds the manages_passwords feature to the pw user provider. It is based
on the patch by Andrew Hust that was integrated into FreeBSD puppet port. It
adds tests covering the create, delete and modify processes of the provider.

This integrates a fix for #7500 that was introduced by the original patch.
The existing code takes the first character of each property and uses it as a
flag. However, with pw, the -p flag is for setting the password expiration.
The result is that the password isn't set at create time and that the password
is set to expire. The next run of puppet correctly sets the password but the
expiry is still set. The new code avoids using -p for passwords, and also sets
the password correctly when an account is created.

Reviewed-by: Patrick Carlisle <patrick@puppetlabs.com>
884381f
@tdb tdb (#10962) Make sure managehome is respected on FreeBSD
When modifying the home directory of a user and managehome is set
the -m flag should be used with pw. This ensures that the new home
directory is created if it doesn't exist.

Also add test to verify this behaviour.
fb111ef
@tdb tdb (#11046) Improve pw group provider on FreeBSD
Make the pw group provider on FreeBSD support managing group members.
Also readd the allowdupe feature since in testing on FreeBSD 7, 8
and 9 the -o flag to pw works as documented.

Add tests for the provider.

Reviewed-by: Patrick Carlisle <patrick@puppetlabs.com>
9b8829d
@tdb tdb (#11046) Add support for user expiry in pw user provider
Add support for setting an expiry date for a user in the pw user
provider. FreeBSD uses the format DD-MM-YYYY rather than Puppet's
YYYY-MM-DD. Tests added to confirm the value is correctly swapped
around.

Also added custom accessor method to take the unix timestamp given
by the operating system to a Puppet-style YYYY-MM-DD. This stops
Puppet from repeatedly trying to set the expiry date if it's already
correct.
032043e
@daniel-pittman daniel-pittman merged commit 75d7cad into puppetlabs:2.7.x Jan 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.