Class: VagrantPlugins::Saltdeps::Config::Provisioner

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-saltdeps/config/provisioner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeProvisioner

Returns a new instance of Provisioner.



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/vagrant-saltdeps/config/provisioner.rb', line 14

def initialize
  super
  @machine       = nil
  @checkout_path = UNSET_VALUE
  @deps_path     = '.vagrant-salt/saltdeps.yml'
  @grains_path   = UNSET_VALUE
  @pillars_path  = UNSET_VALUE
  @merge_pillars = UNSET_VALUE
  @merge_grains  = UNSET_VALUE
  @merged_path   = UNSET_VALUE
  @base_vagrantfile = UNSET_VALUE
end

Instance Attribute Details

#base_vagrantfileObject

Returns the value of attribute base_vagrantfile.



12
13
14
# File 'lib/vagrant-saltdeps/config/provisioner.rb', line 12

def base_vagrantfile
  @base_vagrantfile
end

#checkout_pathObject

Returns the value of attribute checkout_path.



5
6
7
# File 'lib/vagrant-saltdeps/config/provisioner.rb', line 5

def checkout_path
  @checkout_path
end

#deps_pathObject

Returns the value of attribute deps_path.



6
7
8
# File 'lib/vagrant-saltdeps/config/provisioner.rb', line 6

def deps_path
  @deps_path
end

#grains_pathObject

Returns the value of attribute grains_path.



7
8
9
# File 'lib/vagrant-saltdeps/config/provisioner.rb', line 7

def grains_path
  @grains_path
end

#merge_grainsObject

Returns the value of attribute merge_grains.



10
11
12
# File 'lib/vagrant-saltdeps/config/provisioner.rb', line 10

def merge_grains
  @merge_grains
end

#merge_pillarsObject

Returns the value of attribute merge_pillars.



9
10
11
# File 'lib/vagrant-saltdeps/config/provisioner.rb', line 9

def merge_pillars
  @merge_pillars
end

#merged_pathObject

Returns the value of attribute merged_path.



11
12
13
# File 'lib/vagrant-saltdeps/config/provisioner.rb', line 11

def merged_path
  @merged_path
end

#pillars_pathObject

Returns the value of attribute pillars_path.



8
9
10
# File 'lib/vagrant-saltdeps/config/provisioner.rb', line 8

def pillars_path
  @pillars_path
end

Instance Method Details

#finalize!Object



44
45
46
47
48
49
50
51
# File 'lib/vagrant-saltdeps/config/provisioner.rb', line 44

def finalize!
  @grains_path   = '.vagrant-salt/grains'  if @grains_path  == UNSET_VALUE
  @pillars_path  = '.vagrant-salt/pillars' if @pillars_path == UNSET_VALUE
  @merged_path   = '.vagrant-salt'         if @merged_path  == UNSET_VALUE

  @merge_grains  = true if @merge_grains  == UNSET_VALUE
  @merge_pillars = true if @merge_pillars == UNSET_VALUE
end

#validate(machine) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/vagrant-saltdeps/config/provisioner.rb', line 27

def validate(machine)
  @machine = machine
  errors = _detected_errors
  if @checkout_path
    Pathname.new(@checkout_path).expand_path(machine.env.root_path)
  else
    @checkout_path = '.saltdeps'
    Pathname.new(@checkout_path).expand_path(machine.env.root_path)
  end

  expand(@grains_path,  errors)
  expand(@pillars_path, errors)


  return {"salt provisioner" => errors}
end