Adds support for building puppet on RHEL7 via spec.
Add initial support for building in a RHEL 7 mock

Building in an x86_64 mock, since RHEL has not provided a 32-bit release.
(PUP-1278) Windows Puppet Agent Service gracefully terminates after succesfully being put into a Paused state

Removed redundant return statement
Added in logic to only start the Puppet Agent if the service is in a Running or Idle state
(PUP-1411) Initialize OpenSSL before starting TCP connection

Ruby's Net::HTTP#connect method makes a TCP connection before it creates
the OpenSSL::SSL::SSLContext and invokes the SSLSocket#connect method:

    def connect
      s = timeout(@open_timeout) { TCPSocket.open(conn_address(), conn_port()) }
      if use_ssl?
        ...
        @ssl_context = OpenSSL::SSL::SSLContext.new
        s = OpenSSL::SSL::SSLSocket.new(s, @ssl_context)
        ...
      end
      ...
      timeout(@open_timeout) { s.connect }

Between the time that the TCP connection is established (TCPSocket.open)
and when the client starts the SSL handshake (SSLSocket#connect), the server
must hold the TCP connection open[1].

The first time this code path is taken on the client, the call to
SSLContext.new causes the openssl library to be initialized. This can
take a non-trivial amount of time and is highly platform dependent, e.g.
openssl will initialize the cryptographically strong pseudo-random
number generator. On Windows, this typically calls CryptGenRandom among
other things.

In our CI environment, we are seeing this call take upwards of 7
seconds on Windows agents. If the agent connects to a webrick
puppetmaster, then the server will only hold the connection open for 6.2
seconds. See redmine #4762 and commit 711344836. This can lead to the
puppetmaster closing the connection, to protect against DoS attacks.

This commit ensures that we initialize the openssl library prior to
establishing the TCP connection. This reduces the amount of time the
server needs to wait for the client to send the CLIENT_HELLO message and
decreases the likelihood that the server will timeout the connection
unnecessarily.

[1] https://bugs.ruby-lang.org/issues/9459
(PUP-1411) Increase CLIENT_HELLO timeout

Previously, if a client established a TCP connection to the webrick server,
but the server did not receive any data within 6.2 seconds, the server
would close the connection, and report that the client disconnected.

The error message is actually misleading, because if the client did
actively disconnect, e.g. sent FIN or RST, then IO.select would report that the
socket is ready and timeout would not be reached.

This commit increases the timeout to 10 seconds and updates the error
message to more clearly say that the client did not send any data
before the timeout expired.

Note that we perform this check, because OpenSSL's SSL_accept will block
indefinitely, since the underlying socket is blocking by default.
(pup-640) Update report schema for error events

Previously, special handling was added to synthesize a report
event even when the property application failed early. However,
when this change was made the report schema wasn't updated,
so the schema did not allow for several fields in the event
to be null (as they are for one of these synthesized events).

This change updates the report schema to reflect that certain
fields can be null. It also adds a spec test including an error
event, which requires the schema change in order to pass.
Merge pull request #2305 from joshcooper/issue/stable/PUP-1411-SSL_connect_timeout

(PUP-1411) Protect against SSL_connect errors
(PUP-1118) Add acceptance test for using directory envs

This checks that an environment that comes from the environmentdir
setting is usable as an environment.
(PUP-1118) Stop using Environment.new

Instead of creating environments directly, we need to go through the
configured environment loaders, otherwise environments can't come from
other places.
(PUP-1463) Enable puppet.service during upgrade if puppetagent.service was previously enabled
Merge remote-tracking branch 'upstream/stable'

* upstream/stable:
  (PUP-1411) Increase CLIENT_HELLO timeout
  (PUP-1411) Initialize OpenSSL before starting TCP connection
Merge pull request #2298 from mckern/add-el7-to-stable

Apply the RHEL7 work and merge it into stable
Merge branch 'stable'

Conflicts:
	ext/build_defaults.yaml
(PUP-1118) Fix rdoc1 specs to match changes to rdoc puppet_parser_core

PuppetParserCore was updated to pass environment, known_resource_types;
this just catches up the spec, which runs only on 1.8.7, to match the
changes.
Merge pull request #2269 from skottler/PUP-1463

(PUP-1463) Enable puppet.service during upgrade if puppetagent.service was previously enabled
(Maint) Remove dead port code

The port code has been commented out and unmaintained since 5d2f95 (~7
years ago).
Merge pull request #2308 from zaphod42/maint/master/remove-dead-port-code

(Maint) Remove dead port code
(Maint) Fix load order dependency

Running bundle exec rspec spec/unit/module_tool/install_directory_spec.rb
would fail because the Puppet::ModuleTool::InstallDirectory classes
referenced the Errors module without ensuring it was required.

This commit ensures that all of the module_tool leaf code requires its
parent first, and any code that they directly reference, e.g. open-uri
Merge pull request #2306 from zaphod42/feature/master/pup-1118-implement-environment-directory

(PUP-1118) Use directory environments as environments
(maint) Fixing acceptance test failure caused by GH-2293.

We have our own version of "fail" that takes different parameters than Kernel::fail.  This lead to accidentally passing in a backtrace array (what Kernel#fail expects) instead of the original exception object (what Puppet::Util::Errors#fail expects).  This causes a failure when attempting to format the nested exception because it is not the correct type.