Class: PEBuild::Provisioner::PEBootstrap

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

Defined Under Namespace

Classes: AgentRoleRemovedError, AnswersFile, PostInstall, UnsetVersionError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(machine, config) ⇒ PEBootstrap

Returns a new instance of PEBootstrap.



41
42
43
44
45
46
47
48
# File 'lib/pe_build/provisioner/pe_bootstrap.rb', line 41

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.



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

def answer_dir
  @answer_dir
end

#answer_fileObject (readonly)

Returns the value of attribute answer_file.



39
40
41
# File 'lib/pe_build/provisioner/pe_bootstrap.rb', line 39

def answer_file
  @answer_file
end

#work_dirObject (readonly)

Returns the value of attribute work_dir.



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

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)

    ???



54
55
56
57
58
59
60
# File 'lib/pe_build/provisioner/pe_bootstrap.rb', line 54

def configure(root_config)
  late_config_merge(root_config)

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

#provisionObject



62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/pe_build/provisioner/pe_bootstrap.rb', line 62

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