Created
January 21, 2012 21:40
-
-
Save ajdecon/1654135 to your computer and use it in GitHub Desktop.
nfs head node recipe for blogpost
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Recipe for a cluster head node with an NFS share | |
# Install NFS packages | |
package("nfs-common") | |
package("nfs-kernel-server") | |
# Make sure the diretory to be exported exists | |
node.nfs['shared_dirs'].each do |d| | |
directory d do | |
mode "0777" | |
action :create | |
end | |
end | |
# Create the exports file and refresh the NFS exports | |
template "/etc/exports" do | |
source "exports.erb" | |
owner "root" | |
group "root" | |
mode "0644" | |
end | |
# Start the NFS server | |
service "nfs-kernel-server" do | |
action [:enable,:start,:restart] | |
end | |
execute "exportfs" do | |
command "exportfs -a" | |
action :run | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment