Class: Vagrant::Plugin::V1::Provisioner
- Inherits:
-
Object
- Object
- Vagrant::Plugin::V1::Provisioner
- 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
-
#config ⇒ Object
readonly
The configuration for this provisioner.
-
#env ⇒ Object
readonly
The environment which provisioner is running in.
Class Method Summary collapse
-
.config_class ⇒ Config
This method is expected to return a class that is used for configuring the provisioner.
Instance Method Summary collapse
-
#cleanup ⇒ Object
This is the method called to when the system is being destroyed and allows the provisioners to engage in any cleanup tasks necessary.
-
#initialize(env, config) ⇒ Provisioner
constructor
A new instance of Provisioner.
-
#prepare ⇒ Object
This is the method called to “prepare” the provisioner.
-
#provision! ⇒ Object
This is the method called to provision the system.
Constructor Details
#initialize(env, config) ⇒ Provisioner
Returns a new instance of Provisioner.
15 16 17 18 |
# File 'lib/vagrant/plugin/v1/provisioner.rb', line 15 def initialize(env, config) @env = env @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
The configuration for this provisioner. This will be an instance of the ‘Config` class which is part of the provisioner.
13 14 15 |
# File 'lib/vagrant/plugin/v1/provisioner.rb', line 13 def config @config end |
#env ⇒ Object (readonly)
The environment which provisioner is running in. This is the action environment, not a Vagrant::Environment.
9 10 11 |
# File 'lib/vagrant/plugin/v1/provisioner.rb', line 9 def env @env end |
Class Method Details
Instance Method Details
#cleanup ⇒ Object
This is the method called to when the system is being destroyed and allows the provisioners to engage in any cleanup tasks necessary.
45 46 |
# File 'lib/vagrant/plugin/v1/provisioner.rb', line 45 def cleanup end |
#prepare ⇒ Object
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.
34 35 |
# File 'lib/vagrant/plugin/v1/provisioner.rb', line 34 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.)
40 41 |
# File 'lib/vagrant/plugin/v1/provisioner.rb', line 40 def provision! end |