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



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

def initialize
  @inventory_dir      = UNSET_VALUE
  @inventory_filename = UNSET_VALUE
  @groups             = UNSET_VALUE
end

Instance Attribute Details

#groupsObject

Returns the value of attribute groups.



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

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

#inventory_filenameObject

Returns the value of attribute inventory_filename.



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

def inventory_filename
  @inventory_filename
end

Instance Method Details

#finalize!Object



14
15
16
17
18
# File 'lib/vai/config.rb', line 14

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

#validate(machine) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/vai/config.rb', line 20

def validate(machine)
  errors = _detected_errors

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