Class: VagrantPlugins::Vai::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/vai/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



7
8
9
10
# File 'lib/vai/config.rb', line 7

def initialize
  @inventory_dir = UNSET_VALUE
  @groups        = UNSET_VALUE
end

Instance Attribute Details

#groupsObject

Returns the value of attribute groups.



5
6
7
# File 'lib/vai/config.rb', line 5

def groups
  @groups
end

#inventory_dirObject

Returns the value of attribute inventory_dir.



4
5
6
# File 'lib/vai/config.rb', line 4

def inventory_dir
  @inventory_dir
end

Instance Method Details

#finalize!Object



12
13
14
15
# File 'lib/vai/config.rb', line 12

def finalize!
  @inventory_dir = nil if @inventory_dir == UNSET_VALUE
  @groups        = {}  if @groups == UNSET_VALUE
end

#validate(machine) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/vai/config.rb', line 17

def validate(machine)
  errors = _detected_errors

  if !inventory_dir
    errors << "inventory_dir not specified."
  end
  { "ansible inventory provisioner" => errors }
end