class Chef::Provisioning::MachineSpec

Specification for a machine. Sufficient information to find and contact it after it has been set up.

Public Class Methods

new(*args) click to toggle source
Calls superclass method
# File lib/chef/provisioning/machine_spec.rb, line 10
def initialize(*args)
  super
  data['name'] ||= name
  # Upgrade from metal to chef_provisioning ASAP.
  if data['normal'] && !data['normal']['chef_provisioning'] && data['normal']['metal']
    data['normal']['chef_provisioning'] = data['normal'].delete('metal')
  end
end

Public Instance Methods

attrs() click to toggle source
# File lib/chef/provisioning/machine_spec.rb, line 21
def attrs
  data['normal'] ||= {}
  data['normal']['chef_provisioning'] ||= {}
end
from_image() click to toggle source
# File lib/chef/provisioning/machine_spec.rb, line 50
def from_image
  attrs['from_image']
end
from_image=(value) click to toggle source
# File lib/chef/provisioning/machine_spec.rb, line 53
def from_image=(value)
  attrs['from_image'] = value
end
location()
Alias for: reference
location=(value)
Alias for: reference=
reference() click to toggle source

Location of this machine. This should be a freeform hash, with enough information for the driver to look it up and create a Machine object to access it.

This MUST include a 'driver_url' attribute with the driver's URL in it.

chef-provisioning will do its darnedest to not lose this information.

# File lib/chef/provisioning/machine_spec.rb, line 35
def reference
  attrs['reference'] || attrs['location']
end
Also aliased as: location
reference=(value) click to toggle source

Set the location for this machine.

# File lib/chef/provisioning/machine_spec.rb, line 42
def reference=(value)
  attrs.delete('location')
  attrs['reference'] = value
end
Also aliased as: location=