Class: PEBuild::Cap::RunInstall::POSIX

Inherits:
Object
  • Object
show all
Extended by:
OnMachine
Defined in:
lib/pe_build/cap/run_install/posix.rb

Class Method Summary collapse

Methods included from OnMachine

on_machine

Class Method Details

.run_install(machine, installer_path, answers, **options) ⇒ void

This method returns an undefined value.

Run the PE installer on POSIX systems

Parameters:

  • machine (Vagrant::Machine)

    The Vagrant machine on which to run the installation.

  • installer_dir (String)

    A path to the directory where PE installers are kept.

  • answers (String)

    A path to a file containing installation answers.

  • options (Hash)

    a customizable set of options

Options Hash (**options):

  • A (Boolean)

    flag which controls whether the PEM installer introduced in 2016.2 should be used.



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/pe_build/cap/run_install/posix.rb', line 17

def self.run_install(machine, installer_path, answers, **options)
  if options.fetch(:use_pem, false)
    on_machine(machine, "#{installer_path} -c #{answers}")
  else
    on_machine(machine, "#{installer_path} -a #{answers}")
  end

  if machine.communicate.test('which at')
    machine.ui.info I18n.t('pebuild.cap.run_install.scheduling_run')
    machine.communicate.sudo("echo 'PATH=/opt/puppet/bin:/opt/puppetlabs/puppet/bin:$PATH puppet agent -t --waitforcert 10' | at now '+ 1min'")
  end
end