]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Install open-vm-tools on VMware guests
[chef.git] / cookbooks / hardware / recipes / default.rb
index ff02962dbcb5e6966f3262aafa5c11b2c47113aa..793bda175d168003a6fe6e8f6be0fb69c77cde7e 100644 (file)
@@ -91,6 +91,13 @@ when "Supermicro"
   end
 when "IBM"
   units << "0"
+when "VMware, Inc."
+  package "open-vm-tools"
+
+  service "open-vm-tools" do
+    action [:enable, :start]
+    supports :status => true, :restart => true
+  end
 end
 
 units.sort.uniq.each do |unit|
@@ -537,10 +544,18 @@ unless Dir.glob("/sys/class/hwmon/hwmon*").empty?
 end
 
 if node[:hardware][:shm_size]
+  execute "remount-dev-shm" do
+    action :nothing
+    command "/bin/mount -o remount /dev/shm"
+    user "root"
+    group "root"
+  end
+
   mount "/dev/shm" do
-    action [:mount, :remount, :enable]
+    action :enable
     device "tmpfs"
     fstype "tmpfs"
     options "rw,nosuid,nodev,size=#{node[:hardware][:shm_size]}"
+    notifies :run, "execute[remount-dev-shm]"
   end
 end