Method: Beaker::DSL::InstallUtils#install_puppet_from_deb

Defined in:
lib/beaker/dsl/install_utils.rb

#install_puppet_from_deb(host, opts) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Installs Puppet and dependencies from deb

Parameters:

  • host (Host)

    The host to install packages on

  • opts (Hash{Symbol=>String})

    An options hash

Options Hash (opts):

  • :version (String)

    The version of Puppet to install, if nil installs latest version

  • :facter_version (String)

    The version of Facter to install, if nil installs latest version

  • :hiera_version (String)

    The version of Hiera to install, if nil installs latest version

Returns:

  • nil



840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
# File 'lib/beaker/dsl/install_utils.rb', line 840

def install_puppet_from_deb( host, opts )
  if ! host.check_for_package 'lsb-release'
    host.install_package('lsb-release')
  end

  if ! host.check_for_command 'curl'
    on host, 'apt-get install -y curl'
  end

  on host, 'curl -O http://apt.puppetlabs.com/puppetlabs-release-$(lsb_release -c -s).deb'
  on host, 'dpkg -i puppetlabs-release-$(lsb_release -c -s).deb'
  on host, 'apt-get update'

  if opts[:facter_version]
    on host, "apt-get install -y facter=#{opts[:facter_version]}-1puppetlabs1"
  end

  if opts[:hiera_version]
    on host, "apt-get install -y hiera=#{opts[:hiera_version]}-1puppetlabs1"
  end

  if opts[:version]
    on host, "apt-get install -y puppet-common=#{opts[:version]}-1puppetlabs1"
    on host, "apt-get install -y puppet=#{opts[:version]}-1puppetlabs1"
  else
    on host, 'apt-get install -y puppet'
  end
end