puppetlabs/beaker — pull request #299 by justinstoller (2014-06-06 21:56:27+00:00)
Title: Update to `install puppet`

This builds off of PR #259. It uses @apenney's OSX code.

Provides some fix ups to get it working then backfills the ability explicitly set versions of Puppet and its dependencies (we allow people to call versions on EL/Debian based distros but were silently ignoring them). It also fixes an issue with windows that probably meant this method never worked on windows.

And it allows the user to specify a default strategy for when the method doesn't know how to handle installing from native package. The default is the previous behavior of failing hard. There is now a new option to attempt a gem installation if feasible. This doesn't do two things: a) it doesn't attempt to install ruby/rubygems if not on the system and b) it doesn't try to install native dependencies when installing via gems. The latter condition means it is still up to the user to figure out how to do things like install augeas on SLES or Solaris, but I don't know if at this junction it's reasonable for us to take on installing all of Puppet's native dependencies across exotic platforms.

The previous usage of
```ruby
install_puppet()
```
continues to work just as it did across E.L. and Debian distros and failing on others

The recommended usage now is:
```ruby
install_puppet({ :version => '3.6.1', :facter_version => '2.0.1', :hiera_version => '1.3.3', :default_action => 'gem_install'})
```
which will now install those versions of the projects via native packages on E.L., Debian, Windows and OSX, then fall back to gem installation if possible on other platforms.