Commit 57ddcad5 authored by Christopher Huhn's avatar Christopher Huhn 🥚
Browse files

Reload automounter and add cleanup logic

parent 5961c465
...@@ -7,7 +7,7 @@ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) ...@@ -7,7 +7,7 @@ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
source_url 'https://git.gsi.de:chef/cookbooks/cernvm-fs/' source_url 'https://git.gsi.de:chef/cookbooks/cernvm-fs/'
issues_url 'https://git.gsi.de:chef/cookbooks/cernvm-fs/issues' issues_url 'https://git.gsi.de:chef/cookbooks/cernvm-fs/issues'
version "1.0.0" version "1.1.0"
depends "sys", '>= 1.51.0' depends "sys", '>= 1.51.0'
depends "apache2", '< 8.0' depends "apache2", '< 8.0'
......
...@@ -37,9 +37,15 @@ when 9,10 ...@@ -37,9 +37,15 @@ when 9,10
# generated by Chef, cernvm-fs cookbook # generated by Chef, cernvm-fs cookbook
/cvmfs program:/etc/auto.cvmfs /cvmfs program:/etc/auto.cvmfs
EOF EOF
notifies :reload, 'service[autofs]'
end
service 'autofs' do
action :nothing
end end
end end
# Make sure the CMVFS user can use FUSE # Make sure the CMVFS user can use FUSE
# to mount a repositories # to mount a repositories
node.default['sys']['fuse']['config']['mount_max'] = 1000 node.default['sys']['fuse']['config']['mount_max'] = 1000
...@@ -103,13 +109,23 @@ end ...@@ -103,13 +109,23 @@ end
# #
directory '/etc/cvmfs/config.d' directory '/etc/cvmfs/config.d'
# delete repo configs not managed by this cookbook:
Dir.glob('/etc/cvmfs/config.d/*.conf').each do |f|
file f do
action :delete
only_if { node['cvmfs']['client']['config_d_cleanup'] == true }
# keep files with a correspoming attribute:
not_if do
node['cvmfs']['client']['config_d'].key?(File.basename(f,'.conf'))
end
end
end
# Each repository needs its configuration file # Each repository needs its configuration file
node['cvmfs']['client']['config_d'].each do |repo, config| node['cvmfs']['client']['config_d'].each do |repo, config|
template "/etc/cvmfs/config.d/#{repo}.conf" do template "/etc/cvmfs/config.d/#{repo}.conf" do
source 'etc_cvmfs_config.d_generic.conf.erb' source 'etc_cvmfs_config.d_generic.conf.erb'
mode "0644" mode "0644"
variables(config: config) variables(config: config)
end end
end end
Markdown is supported
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