lib/beaker/dsl/install_utils/foss_utils.rb
# Install official puppetlabs release repository configuration on host(s).
#
# @param [Host, Array<Host>, String, Symbol] hosts    One or more hosts to act upon,
#                            or a role (String or Symbol) that identifies one or more hosts.
#
# @note This method only works on redhat-like and debian-like hosts.
#
Install official puppetlabs release repository configuration on host(s).
Install official puppetlabs release repository configuration on host ( s ) .
def install_puppetlabs_release_repo_on( hosts, repo = nil, opts = options )
          block_on hosts do |host|
            variant, version, arch, codename = host['platform'].to_array
            repo_name = repo.nil? ? '' : '-' + repo
            opts = FOSS_DEFAULT_DOWNLOAD_URLS.merge(opts)
            case variant
            when /^(fedora|el|centos)$/
              variant = (($1 == 'centos') ? 'el' : $1)
              remote = "%s/puppetlabs-release%s-%s-%s.noarch.rpm" % [opts[:release_yum_repo_url],
		                                                       repo_name, variant, version]
	      host.install_package_with_rpm(remote, '--replacepkgs', {:package_proxy => opts[:package_proxy]})
            when /^(debian|ubuntu|cumulus)$/
              deb = "puppetlabs-release%s-%s.deb" % [repo_name, codename]
              remote = URI.join( opts[:release_apt_repo_url], deb )
              on host, "wget -O /tmp/puppet.deb #{remote}"
              on host, "dpkg -i --force-all /tmp/puppet.deb"
              on host, "apt-get update"
            else
              raise "No repository installation step for #{variant} yet..."
            end
            configure_type_defaults_on( host )
          end
        end
def install_puppetlabs_release_repo_on ( hosts , repo = nil , opts = options ) block_on hosts do | host | variant , version , arch , codename = host [ 'platform' ] . to_array repo_name = repo . nil? ? '' : '-' + repo opts = FOSS_DEFAULT_DOWNLOAD_URLS . merge ( opts ) case variant when / ^(fedora|el|centos)$ / variant = ( ( $1 == 'centos' ) ? 'el' : $1 ) remote = "%s/puppetlabs-release%s-%s-%s.noarch.rpm" % [ opts [ :release_yum_repo_url ] , repo_name , variant , version ] host . install_package_with_rpm ( remote , '--replacepkgs' , { :package_proxy => opts [ :package_proxy ] } ) when / ^(debian|ubuntu|cumulus)$ / deb = "puppetlabs-release%s-%s.deb" % [ repo_name , codename ] remote = URI . join ( opts [ :release_apt_repo_url ] , deb ) on host , "wget -O /tmp/puppet.deb #{remote}" on host , "dpkg -i --force-all /tmp/puppet.deb" on host , "apt-get update" else raise "No repository installation step for #{variant} yet..." end configure_type_defaults_on ( host ) end end
Install official puppetlabs release repository configuration on host(s).
Install official puppetlabs release repository configuration on host ( s ) .
hosts
<not_specific>
repo
<not_specific>
opts
<not_specific>
options
<not_specific>
<not_specific>
hosts One or more hosts to act upon, or a role (String or Symbol) that identifies one or more hosts.
hosts One or more hosts to act upon or a role ( String or Symbol ) that identifies one or more hosts .
note
This method only works on redhat-like and debian-like hosts.
This method only works on redhat - like and debian - like hosts .