On Thursday, February 7, 2013, John Julien wrote:

> In lib/puppet/feature/libuser.conf:
>
> > @@ -0,0 +1,15 @@
> > +[import]
> > +login_defs = /etc/login.defs
> > +default_useradd = /etc/default/useradd
>
> I think /etc/puppet sounds like a good location. There is a technical
> requirement that this file has to be in a location that can be accurately
> determined at runtime so Puppet::Util::Libuser.setupenv can set the
> environment variable LIBUSER_CONF. Without this, the provider may not work
> as expected.
>

Roger on the runtime determination. I'll answer that in a moment. My only
comment on the LIBUSER_CONF is that we should avoid setting that
environment variable for the entire context of Puppet if possible. A more
ideal implementation will set it only for the context of the provider
commands. A subprocess and a very small wrapper script may accommodate
this, or perhaps the commands support passing the CONF file as an argument.

> I have a few questions about how to move this file to /etc/puppet.
>
> Is /etc/puppet a hard coded part of the puppet package? Can users
> customize this?
>
> I need this method to always be able to find the file:
>
>
The default value is hard coded an the user may customize it. It's also
different for puppet enterprise.  The best way to find it is with
Puppet.settings[:confdir]

Another question, do you think users will ever need different LIBUSER_CONF
configurations for different puppet environments?  It doesn't seem like it,
but it's worth spending a little time considering up front.

def self.getconf
>   File.expand_path("../../feature/libuser.conf", __FILE__)end
>
> How do I code this to work with Puppet Enterprise? Is there a variable I
> can reference so the /etc/puppet and /etc/puppetlabs locations are selected
> appropriately depending on the version being used?
>

Yes, the settings subsystem contains this information.


> How do I get the file in /etc/puppet? Will this happen automatically by
> placing the file under puppet/conf in the project tree or do I have to edit
> installer(s)?
>

This will have to happen as part of install.rb and our other packaging,
e.g. the spec file for RPM's.  It may be worth creating a subdirectory of
the confdir just for provider configuration files.

-Jeff