Class: Vagrant::Plugin::V1::Provisioner

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

Overview

This is the base class for a provisioner for the V1 API. A provisioner is primarily responsible for installing software on a Vagrant guest.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env, config) ⇒ Provisioner

Returns a new instance of Provisioner.



18
19
20
21
# File 'lib/vagrant/plugin/v1/provisioner.rb', line 18

def initialize(env, config)
  @env    = env
  @config = config
end

Instance Attribute Details

#configObject (readonly)

The configuration for this provisioner. This will be an instance of the Config class which is part of the provisioner.



16
17
18
# File 'lib/vagrant/plugin/v1/provisioner.rb', line 16

def config
  @config
end

#envObject (readonly)

The environment which provisioner is running in. This is the action environment, not a Vagrant::Environment.



12
13
14
# File 'lib/vagrant/plugin/v1/provisioner.rb', line 12

def env
  @env
end

Class Method Details

.config_classConfig

This method is expected to return a class that is used for configuring the provisioner. This return value is expected to be a subclass of Config.

Returns:



28
29
# File 'lib/vagrant/plugin/v1/provisioner.rb', line 28

def self.config_class
end

Instance Method Details

#cleanupObject

This is the method called to when the system is being destroyed and allows the provisioners to engage in any cleanup tasks necessary.



48
49
# File 'lib/vagrant/plugin/v1/provisioner.rb', line 48

def cleanup
end

#prepareObject

This is the method called to "prepare" the provisioner. This is called before any actions are run by the action runner (see Actions::Runner). This can be used to setup shared folders, forward ports, etc. Whatever is necessary on a "meta" level.

No return value is expected.



37
38
# File 'lib/vagrant/plugin/v1/provisioner.rb', line 37

def prepare
end

#provision!Object

This is the method called to provision the system. This method is expected to do whatever necessary to provision the system (create files, SSH, etc.)



43
44
# File 'lib/vagrant/plugin/v1/provisioner.rb', line 43

def provision!
end