On Fri, Sep 16, 2011 at 6:26 PM, James Turnbull <[email protected]> wrote:
> dspruell wrote:
>>  Could not find a default provider for user
>
> I'd say this is a variant of http://projects.puppetlabs.com/issues/4963.
>
> A similar fix to the code in that ticket should work.

Seems so, the below patch allows puppet master to bootstrap. Thanks
for the reference. At first glance I wonder if a slight variance is
required for OpenBSD since the useradd(8) utility doesn't support the
-m/-M options for min/max age; it supports these options instead for
account and password expiration:

     -e expiry-time
             Sets the default time at which new accounts will expire.  It
             should be entered in the form ``month day year'', where month is
             the month name (the first three characters are sufficient), day
             is the day of the month, and year is the year.  Time in seconds
             since the Epoch (UTC) is also valid.  A value of 0 can be used to
             disable this feature.

     -f inactive-time
             Sets the time at which passwords of new accounts will expire.
             Also see the -e option above.

These don't seem like complementary options to me (complementary to
minimum/maximum password age, anyway). OpenBSD's useradd(8) is derived
from NetBSD's so the same situation is likely to occur there.

http://www.openbsd.org/cgi-bin/man.cgi?query=useradd&sektion=8
http://netbsd.gw.com/cgi-bin/man-cgi?useradd+8+NetBSD-current

Is a slightly modified provider needed?

----------

--- useradd.rb.bak      Fri Sep 16 23:26:59 2011
+++ useradd.rb  Sat Sep 17 00:15:03 2011
@@ -3,13 +3,13 @@
 Puppet::Type.type(:user).provide :useradd, :parent =>
Puppet::Provider::NameService::ObjectAdd do
   desc "User management via `useradd` and its ilk.  Note that you
will need to install the `Shadow Password` Ruby library often known as
ruby-libshadow to manage user passwords."

-  commands :add => "useradd", :delete => "userdel", :modify =>
"usermod", :password => "chage"
+  commands :add => "useradd", :delete => "userdel", :modify =>
"usermod", :password => "passwd"

   options :home, :flag => "-d", :method => :dir
   options :comment, :method => :gecos
   options :groups, :flag => "-G"
-  options :password_min_age, :flag => "-m"
-  options :password_max_age, :flag => "-M"
+  options :password_min_age, :flag => "-e"
+  options :password_max_age, :flag => "-f"

   verify :gid, "GID must be an integer" do |value|
     value.is_a? Integer

-- 
Darren Spruell
[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to