Add support for DragonFly BSD.

As DragonFly is an offspring of FreeBSD, most of the assumptions for
FreeBSD are valid for DragonFly BSD. The only notable exception is
package management, which is performed using pkgin.

While implementing, a missing function in the FreeBSD service
provider has been noted.
Add stdin parsing to puppet parser validate
(#11727) Support STDIN for `puppet parser validate`

This adds an acceptance test for the STDIN validation feature of the `puppet
parser validate` action.

Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
(#15731) Full certificate metadata for pson

When attempting to get certificate metadata using the REST API, the API
returns a different set of metadata based on whether one requests yaml
or pson, neither of which are the full set of metadata.
This commit adds dns_alt_names/subjectAltNames to the metadata for pson.
(#15731) explicit fingerprint digest for pson

The pson metadata for a certificate (or certificate request) contains a
fingerprint which was created with the default digest algorithm. This
algorithm must change as we move to FIPS 140-2 compliance because MD5 is
explicitly denied.
This commit includes fingerprint metadata for 3 stronger hashing
algorithms and explicitly calls out that the fingerprint is for that
algorithm.
(#16139) Provide accessors for @puppet_version and @report_format in
reports

Prior to this commit, some of the data that was useful / necessary
to write a complete report processor was only accessible via
instance variables, while the vast majority of the data was available
through accessor methods.  This commit simply adds accessors for
puppet_version and report_format so that authors of report processors
aren't forced to interact with instance variables.  This should
make report processor implementation a bit more consistent, and
provides a little bit of abstraction from the underlying implementation
details.
(#15731) Move explicit fingerprints to hash

Move the explicit fingerprints for certificates and certificate requests
to a hash within the normal pson data. This commit makes the format of
the pson:
{
  ...
  fingerprint: <current fingerprint algorithm>
  fingerprints: {
    default: <current fingerprint algorithm>
    SHA1: <sha1 fingerprint>
    SHA256: <sha256 fingerprint>
    SHA512: <sha512 fingerprint>
  }
}

Clean up the tests to reduce duplication and improve clarity of what is
actually being tested in each case.
(Maint) dont fail on path unless absolutely required.

Previously, ensure=>running was required to specify the path. However,
if the zone is already configured, we dont really need the path.
This patch gets rid of that requirement.
- adds spec tests for start.
(Maint) - simplify methods in ZoneMultiConfigProperty (adds wrap).

This patch extracts the arrification into a single method wrap,
and shortens the method definitions by removing redundant code.
(Maint) Type Zone : fix formatting, comments

Add comment explaining why ensure:retrieve is necessary, added the output
of zone info to explain the regex, Fix format space, refactored global
retrieve to make it simple and succinct, simplify autorequire(:zfs),
setstatus, updated the regex in getconfig so that it matches the output
better. Updated the test case for getconfig
(#15886) Refactor state machine

The zone type has an internal statemachine that ensures that the state
transition is linear from configured -> installed -> running.
Previously, the state machine was intertwined with the code of zone
type. This commit extracts the statemachine so that thestatemachine is
in its own class

In order to remove future confusion, we also rename newvalue to seqvalue
and ensure that the newvalue is called from within the seqvalue. The
seqvalue is so named to indicate that the order of declaration of the
seqvalues determine the order of progression of states in the state machine.
Since we call parent newvalue from inside the seqvalue, we can now avoid using
munge which was added for this reason.

- Added test cases for fsm
(Maint) simplify line2hash, ensure iptype exclusive property is correct

Updated line2hash so that the method is succinct and simple, and added test cases for it.
(#15886) remove ZoneConfig and ZoneMultiConfig

Remove the zone specific properties from types, and move their handling to the provider.
This is done so that we can avoid stepping on the toes of puppet core and override methods
that have default behaviors except when necessary. The zone type is also more cleaned up
so that it can serve as a base for other container implementations.

Type: the properties that earlier relied on ZoneMultiConfigProperty are now moved to
Puppet::Property::List. The methods should and insync? are added to override the behaviors in
the parent methods. The should method in parent joins the array values together before
comparison. However, we do not want this behavior, and instead want it to remain as an array.
Hence we override should. We also override insync?  which uses should in parent for the same
reason.

Provider: the def_prop and def_multiprop now handles the definition of properties. They
add the methods prop(), prop=(), and prop_conf() to each properties that the provider provides.

The prop_conf() method is needed for getting the text to send to zonecfg on configure.
(#15886) getstatus should rename ip-type to iptype

previously, getstatus parsed the output of zonecfg info which contained
key `ip-type`. However, we are looking for the key `iptype`. this caused
the zone provider to not detect when iptype was changed, and always assume
the default value 'shared'. This commit gets the ip-type and assigns it to
iptype.
(#15886) commit the complete commands at the end.

Previously, the provider was applying the setconfig commands as soon as
it was called. This caused problems when the commands that were being called
needed to be called in a transactional manner
(i.e eth,exclusive -> eth:ip,shared). This uses flush to pass the required
commands at once through a pipe to zonecfg rather than do it one at a time.
(#15560) Refactor LogonUser

Previously, the ADSI utility code validated a user's password by
attempting a network logon session as that user. However, the ability to
create a logon session and use the resulting process token is something
that is generally useful, in say the next commit.

This commit refactors the call to `LogonUser`, adds a helper method for
checking the validity of a password, and modifies the ADSI code to call
it.

The call to `LogonUser` remains the same except that the MSDN docs say to
specify a '.' as the domain for local user accounts, and we null out the
token handle prior to calling LogonUser instead setting it to
"\x20\x20\x20\x20" which could be interpreted as a valid handle.
(#15560) Create the user's profile if managehome is true

Previously, specifying `managehome => true` on a user resource would have
no effect even though the Windows ADSI user provider claimed to support
the `manages_homedir` feature.

On Windows, a user's homedir (profile) is not created when the user
account is created, but when the user logs in for the first time. As
a result, if Puppet created the user account, and then tried to apply
another resource that depended on the existence of the user's home
directory, such as ssh keys, then Puppet would fail.

This commit changes the Windows ADSI user provider such that if
`managehome` is enabled, then it will load and unload the user's profile.
This will create the profile if necessary and apply the appropriate DACL
to the profile and subdirectories.

This commit follows the Microsoft recommended way of creating a user
profile: http://support.microsoft.com/kb/196070/en-us
(#16058) Add setting to configure catalog cache

This adds a setting to configure the cache terminus used by the catalog
indirection. The two reasonable values at this time are "yaml" and "pson".
(#16058) Set pson as default catalog cache format

Serializing as pson appears to be faster, so set it as the default. Yaml is
still available by setting catalog_cache_terminus.
Add a terminus setting type

The terminus setting type makes it possible to set a terminus to nil by
providing an empty string in the configuration. It also converts the terminus
name to a symbol automatically.

This required making all terminus settings consistently use symbols.