Class: VagrantPlugins::BundleWrap::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::BundleWrap::Config
- Defined in:
- lib/vagrant-bundlewrap/config.rb
Instance Attribute Summary collapse
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#interactive ⇒ Object
Returns the value of attribute interactive.
-
#node_host ⇒ Object
Returns the value of attribute node_host.
-
#node_name ⇒ Object
Returns the value of attribute node_name.
-
#repo_path ⇒ Object
Returns the value of attribute repo_path.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #validate(machine) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
10 11 12 13 14 15 16 |
# File 'lib/vagrant-bundlewrap/config.rb', line 10 def initialize @repo_path = UNSET_VALUE @node_name = UNSET_VALUE @node_host = UNSET_VALUE @interactive = UNSET_VALUE @debug = UNSET_VALUE end |
Instance Attribute Details
#debug ⇒ Object
Returns the value of attribute debug.
7 8 9 |
# File 'lib/vagrant-bundlewrap/config.rb', line 7 def debug @debug end |
#interactive ⇒ Object
Returns the value of attribute interactive.
8 9 10 |
# File 'lib/vagrant-bundlewrap/config.rb', line 8 def interactive @interactive end |
#node_host ⇒ Object
Returns the value of attribute node_host.
6 7 8 |
# File 'lib/vagrant-bundlewrap/config.rb', line 6 def node_host @node_host end |
#node_name ⇒ Object
Returns the value of attribute node_name.
5 6 7 |
# File 'lib/vagrant-bundlewrap/config.rb', line 5 def node_name @node_name end |
#repo_path ⇒ Object
Returns the value of attribute repo_path.
4 5 6 |
# File 'lib/vagrant-bundlewrap/config.rb', line 4 def repo_path @repo_path end |
Instance Method Details
#finalize! ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/vagrant-bundlewrap/config.rb', line 18 def finalize! @repo_path = "bundlewrap/" if @repo_path == UNSET_VALUE @node_name = nil if @node_name == UNSET_VALUE @node_host = nil if @node_host == UNSET_VALUE @debug = false if @debug == UNSET_VALUE @interactive = false if @interactive == UNSET_VALUE end |
#validate(machine) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/vagrant-bundlewrap/config.rb', line 26 def validate(machine) errors = _detected_errors unless File.directory?(repo_path) and File.exist?("#{repo_path}/nodes.py") and File.exist?("#{repo_path}/groups.py") errors << "BundleWrap repository is missing in repo_path='#{repo_path}'.\n" + " Create a new one with 'bw repo create'." end unless @node_name errors << "BundleWrap config 'node_name' is not set. Use the node name from your BundleWrap nodes.py." end unless @node_host errors << "BundleWrap config 'node_host' is not set. Use the node host from your BundleWrap nodes.py.\n" + " This does not have to be a valid host name (e.g. 'node1.vm'), but it should be a unique one,\n" + " because it will be written in your ssh config file." end { "vagrant-bundlewrap" => errors } end |