Fix feature detection error undefined method pointer on nil:NilClass.
(#7911) Allow managing local groups when duplicate names exist in a remote NSS database e.g. LDAP.

Some applications require local accounts and the useradd/groupadd commands currently used by the provider will not create a local account if they already exist remotely.  The libuser commands luseradd/lgroupadd will allow a local name to duplicate a remote name.  So these commands are used to force the local account creation.  The libuser commands parse /etc/libuser.conf to determine which modules to use for creating users.  Files must be the module used to get the desired local account managment.  Because of this, it is necessary for Puppet to ship a libuser.conf file, which will only be used during a Puppet run, to ensure local account managment.  The libuser.conf file used by the luseradd/lgroupadd commands can be overrideen by setting the environment variable LIBUSER_CONF. Which is what Puppet does to make sure its version of the configuration file is used
(#7911) Added support for managing local users.  Also created Puppet::Util::Libuser for better reuse of common code.
(#7911) Removed function def libuser_conf which was made obsolete by Puppet::Util::Libuser
(#7911) Stabalized providers when using libuser commands so it would behave identical to the existing providers

Performed exhaustive analysis of the differences between useradd/groupadd and luseradd/lgroupadd and coded around these differences to ensure that the useradd/groupadd providers behave identically with and without the forcelocal parameter being set.  The only difference being a local account is always created and managed when forcelocal is set to true.  The commands are very similar for the most part so there was not a huge need to diverge from the original code.  In all but one of the cases that did arise the solution was to make a subsequent usermod or groupmod call after the luseradd/lgroupadd command.  Since the usermod/groupmod commands will always act on local accounts first, this achieves the desired effect. The one case where a subsequent call would not suffice was the use of the allowdupe parameter. By default libuser will allow duplicate uid/gid where useradd/groupadd require an explicit -o.  The work around was to manually do a local check for a duplicate if using the libuser library and not intending to allow duplicates.  If a duplicate is found Puppet raises a DuplicateUID or DuplicateGID exception.
(#7911) Fixed failing spec because of invocation of function increase
(#7911) Removed custom exception class for duplicate UID/GID.  Using Puppet::Error now
(#7911) Isolate command environment for libuser commands
(#7911) Moved location of libuser.conf
(#7911) Moved location of libuser.conf
(#7911) Fixed Libuser.getconf, updated unit specs, removed conflicting expiry fix

This commit change the Puppet::Util::Libuser module to look for libuser.conf in its new /etc/puppet/provider/libuser.conf location.  It also updates Puppet::Features::Libuser to only return true if the config file as well as the binaries are found.

Updated the useradd and groupadd specs to expect :execute when called from create to now have 2 parametes.  A command and an options hash.

During my work on this feature I added an exipry getter since the builtin getter didn't retrieve the correct values.  Before this patch was merged another commit came along that also set the proper getter. So I removed mine as it caused a conflict.
(#7911) Cleanup specs, removed unneeded comment
(#7911) Update pw provider specs to account for options hash passed to execute for creates
Ignore splay time on SIGUSR1

If the agent is configured to use splay, receiving a SIGUSR1 while
beeing in the splay loop will cause the agent to wait and instantly
run as documented.

The agent now skips the splay sleep when the signal is received.
Merge branch 'b1-systems-fix_signal_handler'

* b1-systems-fix_signal_handler:
  Ignore splay time on SIGUSR1

closes #1453
(#7165) Properties can invalidate scheduled refreshes on change

An invalidate_refreshes option can now be specified on newvalue calls inside
type definitions.  When a property is changed to a value with this option set,
it causes all currently scheduled refreshes (from notify or subscribe) to be
discarded after evaluation of the resource.

This is designed for instances where a file resource is changed and refreshes
a service resource.  The service itself would then be evaluated, the service is
started and then it would be refreshed, causing an additional restart.  This
change allows a type definition to specify that a property change to a
particular value invalidates certain needless refreshes.
(#7165) Invalidate refreshes after services are started

After a service is started (ensure transitions to :running), discard all
scheduled refreshes which would otherwise cause a restart immediately after it
had started.

This enables the pattern of a file notifying a stopped service resource, which
simply deploys the file, starts the service and leaves it running.
Merge branch 'domcleal-tickets/master/7165-invalidate-refreshes'

* domcleal-tickets/master/7165-invalidate-refreshes:
  (#7165) Invalidate refreshes after services are started
  (#7165) Properties can invalidate scheduled refreshes on change

closes #1459
(#19167) Fix skipped tests due to Tempfile.new block not being run

Tests for extlookup() key lookups were passing a block into Tempfile.new,
which it doesn't run.  The initialization of the CSV file was performed and
then extlookup() was called inside the block.  Since it isn't run, the tests
aren't executed.

This moves the tests out of the block and changes how the CSV file is created,
since the extlookup() function doesn't take an absolute path to a CSV file.
Instead a temporary directory is now created and the CSV file created inside.

An incorrect test that should have checked for a raised error has also been
fixed.
Merge branch 'domcleal-tickets/master/19167-extlookup-spec'

* domcleal-tickets/master/19167-extlookup-spec:
  (#19167) Fix skipped tests due to Tempfile.new block not being run

closes #1469