Class: Vagrant::Provisioners::Base
- Inherits:
-
Object
- Object
- Vagrant::Provisioners::Base
- Includes:
- Util
- Defined in:
- lib/vagrant/provisioners/base.rb
Overview
The base class for a "provisioner." A provisioner is responsible for provisioning a Vagrant system.
This has been abstracted out so it is easy to provide support for multiple solutions.
Direct Known Subclasses
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 ⇒ Object
This method is expected to return a class that is used for configuration for 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) ⇒ Base
constructor
A new instance of Base.
-
#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) ⇒ Base
Returns a new instance of Base.
19 20 21 22 |
# File 'lib/vagrant/provisioners/base.rb', line 19 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.
17 18 19 |
# File 'lib/vagrant/provisioners/base.rb', line 17 def config @config end |
#env ⇒ Object (readonly)
The environment which provisioner is running in. This is the action environment, not a Vagrant::Environment.
13 14 15 |
# File 'lib/vagrant/provisioners/base.rb', line 13 def env @env end |
Class Method Details
.config_class ⇒ Object
This method is expected to return a class that is used for configuration for the provisioner.
26 |
# File 'lib/vagrant/provisioners/base.rb', line 26 def self.config_class; end |
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.
41 |
# File 'lib/vagrant/provisioners/base.rb', line 41 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.
32 |
# File 'lib/vagrant/provisioners/base.rb', line 32 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.)
37 |
# File 'lib/vagrant/provisioners/base.rb', line 37 def provision!; end |