Class: Vagrant::Boxen::Provisioner

Inherits:
Provisioners::Base
  • Object
show all
Defined in:
lib/vagrant-boxen/provisioner.rb

Defined Under Namespace

Classes: Config

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env, config, provisioner = nil) ⇒ Provisioner

Returns a new instance of Provisioner.



38
39
40
41
42
# File 'lib/vagrant-boxen/provisioner.rb', line 38

def initialize(env, config, provisioner = nil)
  super(env, config)
  @manifests_dir      = "/tmp/vagrant-boxen-#{env['vm'].uuid}"
  @puppet_provisioner = provisioner ? provisioner : setup_puppet_provisioner
end

Class Method Details

.config_classObject



34
35
36
# File 'lib/vagrant-boxen/provisioner.rb', line 34

def self.config_class
  Config
end

Instance Method Details

#prepareObject



44
45
46
47
48
49
# File 'lib/vagrant-boxen/provisioner.rb', line 44

def prepare
  Dir.mkdir @manifests_dir unless File.directory? @manifests_dir
  builder = ManifestBuilder.new(config)
  File.open("#{@manifests_dir}/site.pp", 'w') { |f| f.print builder.build }
  @puppet_provisioner.prepare
end

#provision!Object



51
52
53
# File 'lib/vagrant-boxen/provisioner.rb', line 51

def provision!
  @puppet_provisioner.provision!
end