lib/beaker/dsl/install_utils/pe_utils.rb
#Create the PE install command string based upon the host and options settings
# @param [Host] host The host that PE is to be installed on
#                    For UNIX machines using the full PE installer, the host object must have the 'pe_installer' field set correctly.
# @param [Hash{Symbol=>String}] opts The options
# @option opts [String]  :pe_ver Default PE version to install or upgrade to
#                          (Otherwise uses individual hosts pe_ver)
# @option opts [Boolean] :pe_debug (false) Should we run the installer in debug mode?
# @example
#      on host, "#{installer_cmd(host, opts)} -a #{host['working_dir']}/answers"
# @api private
Create the PE install command string based upon the host and options settings
Create the PE install command string based upon the host and options settings
def installer_cmd(host, opts)
          version = host['pe_ver'] || opts[:pe_ver]
          if host['roles'].include? 'frictionless' and ! version_is_less(version, '3.2.0')
            frictionless_install_opts = []
            if host.has_key?('frictionless_options') and !  version_is_less(version, '3.4.0')
              host['frictionless_options'].each do |section, settings|
                settings.each do |key, value|
                  frictionless_install_opts << "#{section}:#{key}=#{value}"
                end
              end
            end
            pe_debug = host[:pe_debug] || opts[:pe_debug] ? ' -x' : ''
            if host['platform'] =~ /aix/ then
              curl_opts = '--tlsv1 -O'
            else
              curl_opts = '--tlsv1 -kO'
            end
            "cd #{host['working_dir']} && curl #{curl_opts} https://#{master}:8140/packages/#{version}/install.bash && bash#{pe_debug} install.bash #{frictionless_install_opts.join(' ')}".strip
          elsif host['platform'] =~ /osx/
            version = host['pe_ver'] || opts[:pe_ver]
            pe_debug = host[:pe_debug] || opts[:pe_debug] ? ' -verboseR' : ''
            "cd #{host['working_dir']} && hdiutil attach #{host['dist']}.dmg && installer#{pe_debug} -pkg /Volumes/puppet-enterprise-#{version}/puppet-enterprise-installer-#{version}.pkg -target /"
          elsif host['platform'] =~ /eos/
            host.install_from_file("puppet-enterprise-#{version}-#{host['platform']}.swix")
          else
            pe_debug = host[:pe_debug] || opts[:pe_debug]  ? ' -D' : ''
            "cd #{host['working_dir']}/#{host['dist']} && ./#{host['pe_installer']}#{pe_debug} -a #{host['working_dir']}/answers"
          end
        end
def installer_cmd ( host , opts ) version = host [ 'pe_ver' ] || opts [ :pe_ver ] if host [ 'roles' ] . include? 'frictionless' and ! version_is_less ( version , '3.2.0' ) frictionless_install_opts = [ ] if host . has_key? ( 'frictionless_options' ) and ! version_is_less ( version , '3.4.0' ) host [ 'frictionless_options' ] . each do | section , settings | settings . each do | key , value | frictionless_install_opts << "#{section}:#{key}=#{value}" end end end pe_debug = host [ :pe_debug ] || opts [ :pe_debug ] ? ' -x' : '' if host [ 'platform' ] =~ / aix / then curl_opts = '--tlsv1 -O' else curl_opts = '--tlsv1 -kO' end "cd #{host['working_dir']} && curl #{curl_opts} https://#{master}:8140/packages/#{version}/install.bash && bash#{pe_debug} install.bash #{frictionless_install_opts.join(' ')}" . strip elsif host [ 'platform' ] =~ / osx / version = host [ 'pe_ver' ] || opts [ :pe_ver ] pe_debug = host [ :pe_debug ] || opts [ :pe_debug ] ? ' -verboseR' : '' "cd #{host['working_dir']} && hdiutil attach #{host['dist']}.dmg && installer#{pe_debug} -pkg /Volumes/puppet-enterprise-#{version}/puppet-enterprise-installer-#{version}.pkg -target /" elsif host [ 'platform' ] =~ / eos / host . install_from_file ( "puppet-enterprise-#{version}-#{host['platform']}.swix" ) else pe_debug = host [ :pe_debug ] || opts [ :pe_debug ] ? ' -D' : '' "cd #{host['working_dir']}/#{host['dist']} && ./#{host['pe_installer']}#{pe_debug} -a #{host['working_dir']}/answers" end end
Create the PE install command string based upon the host and options settings
Create the PE install command string based upon the host and options settings
# Frictionless install didn't exist pre-3.2.0, so in that case we fall # through and do a regular install. # PE 3.4 introduced the ability to pass in config options to the bash script in the form # of <section>:<key>=<value> # since we have options to pass in, we need to tell the bash script
host
<not_specific>
opts
None
<not_specific>
opts The options
opts The options
example
None
api
None