Advertisement
Guest User

chef node attribute, wtf?

a guest
May 22nd, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.55 KB | None | 0 0
  1.   ruby_block "Create or attach LVM volume out of #{raid_device}" do
  2.     block do
  3.       BlockDevice.create_lvm(raid_device, options)
  4.       node.set[:ebs][:devicetomount] = node[:ebs][:lvm_device]
  5.       node.save unless Chef::Config[:solo]
  6.     end
  7.     only_if { options[:uselvm] }
  8.     action :create
  9.   end
  10.  
  11.   mount options[:mount_point] do
  12.     fstype options[:fstype]
  13.     device node[:ebs][:devicetomount]
  14.     options "noatime"
  15.     not_if do
  16.       File.read('/etc/mtab').split("\n").any?{|line| line.match(" #{options[:mount_point]} ")}
  17.     end
  18.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement