Class: VagrantPlugins::CORL::Provisioner::CORL

Inherits:
Object
  • Object
show all
Defined in:
lib/core/vagrant/provisioner/provisioner.rb

Instance Method Summary collapse

Constructor Details

#initialize(machine, config) ⇒ CORL


Constructor / Destructor



10
11
12
# File 'lib/core/vagrant/provisioner/provisioner.rb', line 10

def initialize(machine, config)
  super
end

Instance Method Details

#configure(root_config) ⇒ Object


Operations



17
18
# File 'lib/core/vagrant/provisioner/provisioner.rb', line 17

def configure(root_config)
end

#provisionObject




22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/core/vagrant/provisioner/provisioner.rb', line 22

def provision
  @machine.communicate.tap do |comm|
    unless ::CORL::Vagrant.command
      # Hackish solution to ensure our code has access to Vagrant machines.
      # This serves as a Vagrant VM manager.
      ::CORL::Vagrant.command = Command::Launcher.new([], @machine.env)
    end

    network = config.network
    node    = config.node

    if network && node
      # Provision the server
      success = network.init_node(node, clean(::CORL.config(:vagrant_node_init, {
        :force             => config.force_updates,
        :home              => config.user_home,
        :home_env_var      => config.user_home_env_var,
        :root_user         => config.root_user,
        :root_home         => config.root_home,
        :bootstrap         => config.bootstrap,
        :bootstrap_path    => config.bootstrap_path,
        :bootstrap_glob    => config.bootstrap_glob,
        :bootstrap_init    => config.bootstrap_init,
        :bootstrap_scripts => config.bootstrap_scripts,
        :reboot            => config.reboot,
        :dev_build         => config.dev_build,
        :ruby_version      => config.ruby_version,
        :auth_files        => config.auth_files,
        :seed              => config.seed,
        :project_reference => config.project_reference,
        :project_branch    => config.project_branch,
        :environment       => config.environment,
        :build             => config.build,
        :provision         => config.provision,
        :dry_run           => config.dry_run
      }).export))

      node.warn("CORL provisioner failed", { :i18n => false }) unless success
    end
  end
end