Class: PEBuild::Provisioner::PEBootstrap

Inherits:
Object
  • Object
show all
Defined in:
lib/pe_build/provisioner/pe_bootstrap.rb

Defined Under Namespace

Classes: AnswersFile, PostInstall, UnsetVersionError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(machine, config) ⇒ PEBootstrap

Returns a new instance of PEBootstrap.



36
37
38
39
40
41
42
43
# File 'lib/pe_build/provisioner/pe_bootstrap.rb', line 36

def initialize(machine, config)
  super

  @logger = Log4r::Logger.new('vagrant::provisioners::pe_bootstrap')

  @work_dir   = File.join(@machine.env.root_path.join, PEBuild::WORK_DIR)
  @answer_dir = File.join(work_dir, 'answers')
end

Instance Attribute Details

#answer_dirObject (readonly)

Returns the value of attribute answer_dir.



30
31
32
# File 'lib/pe_build/provisioner/pe_bootstrap.rb', line 30

def answer_dir
  @answer_dir
end

#answer_fileObject (readonly)

Returns the value of attribute answer_file.



34
35
36
# File 'lib/pe_build/provisioner/pe_bootstrap.rb', line 34

def answer_file
  @answer_file
end

#work_dirObject (readonly)

Returns the value of attribute work_dir.



26
27
28
# File 'lib/pe_build/provisioner/pe_bootstrap.rb', line 26

def work_dir
  @work_dir
end

Instance Method Details

#configure(root_config) ⇒ void

This method returns an undefined value.

Instantiate all working directory content and stage the PE installer.

Parameters:

  • root_config (Object)

    ???



49
50
51
52
53
54
55
# File 'lib/pe_build/provisioner/pe_bootstrap.rb', line 49

def configure(root_config)
  late_config_merge(root_config)

  unless File.directory? work_dir
    FileUtils.mkdir_p work_dir
  end
end

#provisionObject



56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/pe_build/provisioner/pe_bootstrap.rb', line 56

def provision
  load_archive

  if pe_installed?
    machine.ui.warn I18n.t('pebuild.provisioner.pe_bootstrap.already_installed'),
                    :name  => machine.name
  else
    prepare_answers_file
    fetch_installer
    run_install
    run_postinstall_tasks
  end
end