Commit 0f720120 authored by Dennis Klein's avatar Dennis Klein
Browse files

make use of nfs cookbook

parent a61061cb
......@@ -3,5 +3,5 @@ maintainer_email "hpc@gsi.de"
license "All rights reserved"
description "Installs/Configures fai"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.3.0"
version "0.4.0"
depends "nfs"
......@@ -14,6 +14,11 @@ include_recipe "nfs::server"
package "fai-server"
#package fai-quickstart ???
ohai 'dpkg' do
plugin 'dpkg'
action :reload
end
# fallback to admit access to everybody if not specified
node[:fai][:clients] = [ "*" ] if node[:fai][:clients].empty?
......@@ -26,20 +31,30 @@ if node.fai.configdir
action :create
# TODO: fill from version control or sample scripts
end
node[:fai][:clients].each do |client|
node.default[:nfs][:exports] = ["#{node[:fai][:configdir]} #{client}(ro,async,subtree_check)"]
nfs_export '/srv/fai/config' do
network client
writeable false
sync false
options ['subtree_check','no_root_squash']
end
end
node[:fai][:insecure_clients].each do |insecure_client|
node.default[:nfs][:exports] = ["#{node[:fai][:configdir]} #{insecure_client}(ro,async,subtree_check,insecure)"]
nfs_export '/srv/fai/config' do
network insecure_client
writeable false
sync false
options ['subtree_check','no_root_squash','insecure']
end
end
end
# There have been some changes to FAI v4, which is shipped on Wheezy
nfsroot_config = "make-fai-nfsroot.conf"
if node.lsb.codename == "wheezy"
if (node.lsb.codename == "wheezy") or (node.lsb.codename == "jessie")
nfsroot_config = "nfsroot.conf"
end
......@@ -128,9 +143,19 @@ if node.fai.setup_default
end
node[:fai][:clients].each do |client|
node.default[:nfs][:exports] = ["/srv/fai/nfsroot #{client}(ro,no_root_squash,async,subtree_check)"]
nfs_export '/srv/fai/nfsroot' do
network client
writeable false
sync false
options ['subtree_check', 'no_root_squash']
end
end
node[:fai][:insecure_clients].each do |insecure_client|
node.default[:nfs][:exports] = ["/srv/fai/nfsroot #{insecure_client}(ro,async,subtree_check,insecure)"]
nfs_export '/srv/fai/nfsroot' do
network insecure_client
writeable false
sync false
options ['subtree_check', 'no_root_squash','insecure']
end
end
......@@ -6,7 +6,7 @@ end
nfsroot_config = "make-fai-nfsroot.conf"
nfsroot_cmd = "make-fai-nfsroot"
if node.lsb.codename == "wheezy"
if (node.lsb.codename == "wheezy") or (node.lsb.codename == "jessie")
nfsroot_config = "nfsroot.conf"
nfsroot_cmd = "fai-make-nfsroot"
end
......@@ -104,7 +104,12 @@ node.fai.flavors.each do |f, pkgs|
end
node[:fai][:clients].each do |client|
node.default[:nfs][:exports] = ["#{nfs_dir} #{client}(ro,no_root_squash,async,subtree_check)"]
nfs_export nfs_dir do
network client
writeable false
sync false
options ['subtree_check', 'no_root_squash']
end
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment