Class: VagrantPlugins::PuppetInstall::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-puppet-install/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



30
31
32
# File 'lib/vagrant-puppet-install/config.rb', line 30

def initialize
  @version = UNSET_VALUE
end

Instance Attribute Details

#versionString

Returns The version of Chef to install.

Returns:

  • (String)

    The version of Chef to install.



28
29
30
# File 'lib/vagrant-puppet-install/config.rb', line 28

def version
  @version
end

Instance Method Details

#finalize!Object



34
35
36
37
38
39
40
41
# File 'lib/vagrant-puppet-install/config.rb', line 34

def finalize!
  if @version == UNSET_VALUE
    @version = nil
  elsif @version.to_s == 'latest'
    # resolve `latest` to a real version
    @version = retrieve_latest_puppet_version
  end
end

#validate(machine) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
# File 'lib/vagrant-puppet-install/config.rb', line 43

def validate(machine)
  errors = []

  unless valid_chef_version?(chef_version)
    msg = "'#{chef_version}' is not a valid version of Chef."
    msg << "\n\n A list of valid versions can be found at: http://www.opscode.com/chef/install/"
    errors << msg
  end

  { "Omnibus Plugin" => errors }
end