Skip to content

Instantly share code, notes, and snippets.

@chrisroberts
Created June 26, 2013 15:52
Show Gist options
  • Save chrisroberts/5868624 to your computer and use it in GitHub Desktop.
Save chrisroberts/5868624 to your computer and use it in GitHub Desktop.
1.9.3-p327 :004 > resource = Chef::Util::AttributeStruct.new
=> #<Chef::Util::AttributeStruct>
1.9.3-p327 :005 > resource.interfaces('eth0') do
1.9.3-p327 :006 > ipaddress '192.168.0.1'
1.9.3-p327 :007?> gateway '192.168.0.1'
1.9.3-p327 :008?> netmask '255.255.255.0'
1.9.3-p327 :009?> enabled true
1.9.3-p327 :010?> end
=> #<Chef::Util::AttributeStruct eth0=#<Chef::Util::AttributeStruct ipaddress="192.168.0.1", gateway="192.168.0.1", netmask="255.255.255.0", enabled=true>>
1.9.3-p327 :011 > resource.name 'pow'
=> "pow"
1.9.3-p327 :012 > resource._dump
=> {:interfaces=>{:eth0=>{:ipaddress=>"192.168.0.1", :gateway=>"192.168.0.1", :netmask=>"255.255.255.0", :enabled=>true}}, :name=>"pow"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment