Class: Vagrant::Boxen::Provisioner
- Inherits:
-
Provisioners::Base
- Object
- Provisioners::Base
- Vagrant::Boxen::Provisioner
- Defined in:
- lib/vagrant-boxen/provisioner.rb
Defined Under Namespace
Classes: Config
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(env, config, provisioner = nil) ⇒ Provisioner
constructor
A new instance of Provisioner.
- #prepare ⇒ Object
- #provision! ⇒ Object
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_class ⇒ Object
34 35 36 |
# File 'lib/vagrant-boxen/provisioner.rb', line 34 def self.config_class Config end |
Instance Method Details
#prepare ⇒ Object
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 |