lib/rubber/recipes/rubber/volumes.rb in sml-rubber-0.9.13 vs lib/rubber/recipes/rubber/volumes.rb in sml-rubber-1.5.5

- old
+ new

@@ -102,11 +102,11 @@ # we don't mount/format at this time if we are doing a RAID array if vol_spec['mount'] && vol_spec['filesystem'] # then format/mount/etc if we don't have an entry in hosts file task :_setup_volume, :hosts => ic.external_ip do - rubber.run_script 'setup_volume', <<-ENDSCRIPT + rubber.sudo_script 'setup_volume', <<-ENDSCRIPT if ! grep -q '#{vol_spec['mount']}' /etc/fstab; then if mount | grep -q '#{vol_spec['mount']}'; then umount '#{vol_spec['mount']}' fi mv /etc/fstab /etc/fstab.bak @@ -133,11 +133,11 @@ # Only create the partition if we haven't already done so ic.partitions ||= [] if ! ic.partitions.include?(part_id) # then format/mount/etc if we don't have an entry in hosts file task :_setup_partition, :hosts => ic.external_ip do - rubber.run_script 'setup_partition', <<-ENDSCRIPT + rubber.sudo_script 'setup_partition', <<-ENDSCRIPT if ! fdisk -l 2>&1 | grep -q '#{partition_spec['partition_device']}'; then if grep -q '#{partition_spec['disk_device']}\\b' /etc/fstab; then umount #{partition_spec['disk_device']} mv /etc/fstab /etc/fstab.bak cat /etc/fstab.bak | grep -v '#{partition_spec['disk_device']}\\b' > /etc/fstab @@ -173,11 +173,11 @@ partitions.each do |partition| zero_script << "nohup dd if=/dev/zero bs=1M of=#{partition} &> /dev/null &\n" end # then format/mount/etc if we don't have an entry in hosts file task :_zero_partitions, :hosts => ic.external_ip do - rubber.run_script 'zero_partitions', <<-ENDSCRIPT + rubber.sudo_script 'zero_partitions', <<-ENDSCRIPT # zero out parition for performance (see amazon DevGuide) echo "Zeroing out raid partitions to improve performance, this way take a while" #{zero_script} echo "Waiting for partitions to zero out" @@ -198,10 +198,10 @@ else mdadm_init = "mdadm --assemble #{raid_spec['device']} #{raid_spec['source_devices'].sort.join(' ')}" end task :_setup_raid_volume, :hosts => ic.external_ip do - rubber.run_script 'setup_raid_volume', <<-ENDSCRIPT + rubber.sudo_script 'setup_raid_volume', <<-ENDSCRIPT if ! grep -q '#{raid_spec['device']}' /etc/fstab; then if mount | grep -q '#{raid_spec['mount']}'; then umount '#{raid_spec['mount']}' fi mv /etc/fstab /etc/fstab.bak