lib/kuzushi.rb in kuzushi-0.0.12 vs lib/kuzushi.rb in kuzushi-0.0.13
- old
+ new
@@ -89,11 +89,12 @@
end
def process_packages
@packages = get_array("packages")
task "install packages" do
- shell "apt-get update && apt-get upgrade -y && apt-get install -y #{@packages.join(" ")}"
+ shell "apt-get update && apt-get upgrade -y"
+ shell "apt-get install -y #{@packages.join(" ")}" if @packages.empty?
end
end
def process_local_packages(p)
package(p) do |file|
@@ -108,10 +109,11 @@
shell "gem install #{gem} --no-rdoc --no-ri"
end
end
def process_volumes(v)
+ handle_tmpfs v if v.media == "tmpfs"
handle_ebs v if v.media == "ebs"
handle_raid v if v.media == "raid"
set_readahead v if v.readahead
set_scheduler v if v.scheduler
handle_format v if v.format
@@ -145,25 +147,18 @@
o << "mode=#{m.mode}" if m.mode
o << "noatime" if o.empty?
o
end
- def handle_mount_tmpfs(m)
+ def handle_tmpfs(m)
task "mount #{m.mount}" do
shell "mkdir -p #{m.mount} && mount -o #{mount_options(m)} -t tmpfs tmpfs #{m.mount}" unless mounted?(m.mount)
end
end
- def handle_mount_device(m)
+ def handle_mount(m)
task "mount #{m.mount}" do
shell "mkdir -p #{m.mount} && mount -o #{mount_options(m)} #{m.device} #{m.mount}" unless mounted?(m.mount)
- end
- end
-
- def handle_mount(m)
- case m.media
- when "tmpfs" then handle_mount_tmpfs(m)
- else handle_mount_device(m)
end
end
def system_arch
system.kernel["machine"]