(PUP-1586) allow managing existing cronjobs without caring for command

When the catalog contains a cron resource that does not specify a value
for the command property, the transaction would fail with the cryptic
error message 'no command, somehow' under certain conditions.

This error is spurious. Generally, it's quite allowable to manage a subset
of cron properties that does not include the command. Fixed by removing
the devfail invocation. The command property is now handled just like
the 'special' property.
(PUP-1586) remove obsolete unit test

The cron type unit test titled "it should require a command when adding
a new entry" did not quite do what it said. What it actually tested was
that the type would raise an exception when an empty command should-value
was accessed.

This can be safely removed, as PUP-1587 will implement a more sensible
protection against the creation of cronjobs that lack a command, including
a working integration test.
(PUP-1587) crontab: make sure that invalid crontabs aren't written out

It is permissible to manage cron entries and not manage the command
property. However, if the entry doesn't exist on the target system yet,
puppet should not try to create it.

In other words, a cron resource without a should value for the command
property can only be synced to a valid state if the corresponding resource
on the target system has a valid command value already.

cron { "foo": minute => 1 }

is alright with an existing crontab of

 # Puppet Name: foo
 * * * * * /some/command

but not with a crontab not yet containing the entry named 'foo'.

This change prevents the sync operation in the error scenario.
(maint) Use git mirrors for puppet/hiera/facter installation

The git server and fork used to construct git urls for installation
projects via beaker was previously hard set to be github.com and
puppetlabs.  While we continue to default to these values, this commit
allows them to be set globally or per installed project via environment
variables so that we can take advantage of internal and local git
mirrors and daemons.
(maint) Improve tests to check actual logging

The previous tests didn't actually make sure that the diff was logged.
This adds that coverage as well as checking that the log is at the
correct level.
(PUP-2033) Use loglevel for diff output

This brings the same changes made to the file type for PUP-1846 to the
augeas provider's diffing logic. If a loglevel is specified on the
resource then the diff will be logged at that level. If it is left off,
then the diff will be logged at the notice level.
(PUP-2039) Fix rpm package provider usage of --whatprovides.

The fix for PUP-897 (commit ecb761e24a) introduced always passing
--whatprovides to rpm when querying for packages. This breaks querying
for packages that have architectures specified, e.g.
'vim-enhanced.x86_64'.

The proper way to do this is to first query without --whatprovides and
see if rpm finds a package by the given name.  If rpm fails to find a
package, fallback to using --whatprovides to support querying for
virtual package names.
Merge pull request #2469 from zaphod42/feature/master/pup-2033-augeas-show-diff

(PUP-2033) Use loglevel for diff output
Merge pull request #2428 from jpartlow/maint/stable/acceptance-gitmirror

(maint) Use git mirrors for puppet/hiera/facter installation
Merge branch 'stable'

* stable:
  (maint) Use git mirrors for puppet/hiera/facter installation
Merge pull request #2331 from ticket/master/PUP-1587-catch-empty-cron-entries

(PUP-1587) crontab: make sure that invalid crontabs aren't written out
(PUP-1586) remove obsolete unit test
(PUP-1586) allow managing existing cronjobs without caring for command

Signed-off-by: Charlie Sharpsteen <Charlie Sharpsteen chuck@puppetlabs.com>
(maint) Update required params when creating cron jobs

The cron type only requires `command` and a schedule component _when creating
jobs_. `user` is not strictly required as a default will be used.

When managing existing jobs, one only needs to provide the properties to manage
and the namevar.
Merge pull request #2476 from peterhuene/pup/2039

(PUP-2039) Fix rpm package provider usage of --whatprovides.
(PUP-1937) Revert changes to with_version

Changes were made to with_version for Windows to use beaker's puppet
command instead of Command.new directly. This change is now reverted.
Merge pull request #2481 from colinPL/revert_withver_stable

(PUP-1937) Revert changes to with_version
Merge remote-tracking branch 'upstream/stable'

* upstream/stable:
  (PUP-1937) Revert changes to with_version
  (PUP-2039) Fix rpm package provider usage of --whatprovides.
(DOCUMENT-22) Clarify the cron properties user and target

For the default cron provider, `user` and `target` are tightly coupled which
creates a brittle and unhealthy relationship. Re-worded the doc strings for
these properties to call out this relationship and recommend that `user` be
used instead of `target`.
(maint) Document Cron autorequre of user resources

A Cron resource will autorequire the an User resource with the name specified
by its `user` property.
(maint) Ensure Beaker failure bubbles up through Rake

When running Beaker from our acceptance Rake tasks, exceptions from the
shell for a failed test run were being lost.  The Rake sh() helper does
not raise an exception for non-zero exit codes if you pass it a block to
inspect the process results.

This commit passes no block to the sh() helper so that failed beaker
runs will raise an exception, causing Rake to exit non-zero.  The code
to preserve_configuration for re-runs is simplified as well so that we
always generate a preserved_config.yaml unless we are currently running
with one.
Merge pull request #2482 from jpartlow/maint/stable/acceptance-rake-exits-non-zero

(maint) Ensure Beaker failure bubbles up through Rake