lib/beaker/dsl/install_utils/pe_utils.rb
#Determine the PE package to download/upload on a mac host, download/upload that package onto the host.
# Assumed file name format: puppet-enterprise-3.3.0-rc1-559-g97f0833-osx-10.9-x86_64.dmg.
# @param [Host] host The mac host to download/upload and unpack PE onto
# @param  [Hash{Symbol=>Symbol, String}] opts The options
# @option opts [String] :pe_dir Default directory or URL to pull PE package from
#                  (Otherwise uses individual hosts pe_dir)
# @option opts [Boolean] :fetch_local_then_push_to_host determines whether
#                 you use Beaker as the middleman for this (true), or curl the
#                 file from the host (false; default behavior)
# @api private
Determine the PE package to download/upload on a mac host, download/upload that package onto the host.
Determine the PE package to download / upload on a mac host download / upload that package onto the host .
def fetch_pe_on_mac(host, opts)
          path = host['pe_dir'] || opts[:pe_dir]
          local = File.directory?(path)
          filename = "#{host['dist']}"
          extension = ".dmg"
          if local
            if not File.exists?("#{path}/#{filename}#{extension}")
              raise "attempting installation on #{host}, #{path}/#{filename}#{extension} does not exist"
            end
            scp_to host, "#{path}/#{filename}#{extension}", "#{host['working_dir']}/#{filename}#{extension}"
          else
            if not link_exists?("#{path}/#{filename}#{extension}")
              raise "attempting installation on #{host}, #{path}/#{filename}#{extension} does not exist"
            end
            if opts[:fetch_local_then_push_to_host]
              fetch_and_push_pe(host, path, filename, extension)
            else
              on host, "cd #{host['working_dir']}; curl -O #{path}/#{filename}#{extension}"
            end
          end
        end
def fetch_pe_on_mac ( host , opts ) path = host [ 'pe_dir' ] || opts [ :pe_dir ] local = File . directory? ( path ) filename = "#{host['dist']}" extension = ".dmg" if local if not File . exists? ( "#{path}/#{filename}#{extension}" ) raise "attempting installation on #{host}, #{path}/#{filename}#{extension} does not exist" end scp_to host , "#{path}/#{filename}#{extension}" , "#{host['working_dir']}/#{filename}#{extension}" else if not link_exists? ( "#{path}/#{filename}#{extension}" ) raise "attempting installation on #{host}, #{path}/#{filename}#{extension} does not exist" end if opts [ :fetch_local_then_push_to_host ] fetch_and_push_pe ( host , path , filename , extension ) else on host , "cd #{host['working_dir']}; curl -O #{path}/#{filename}#{extension}" end end end
Determine the PE package to download/upload on a mac host, download/upload that package onto the host.
Determine the PE package to download / upload on a mac host download / upload that package onto the host .
host
<not_specific>
opts
:fetch_local_then_push_to_host determines whether you use Beaker as the middleman for this (true), or curl the file from the host (false; default behavior)
: fetch_local_then_push_to_host determines whether you use Beaker as the middleman for this ( true ) or curl the file from the host ( false ; default behavior )
<not_specific>
opts The options
opts The options
api
None