Commit e457c3ef authored by Matthias Pausch's avatar Matthias Pausch
Browse files

Remove autofs-maps that would not have been created in the chef-run from /etc/auto.master.d/

parent 97f42e7b
......@@ -6,4 +6,4 @@ description 'System Software configuration and maintenance'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
source_url 'https://github.com/GSI-HPC/sys-chef-cookbook'
issues_url 'https://github.com/GSI-HPC/sys-chef-cookbook/issues'
version '1.23.4'
version '1.24.0'
......@@ -61,6 +61,16 @@ if ! node['sys']['autofs']['ldap'].empty? && File.exist?('/usr/bin/kinit')
directory '/etc/auto.master.d'
delete = Dir.glob('/etc/auto.master.d/*')
keep = node['sys']['autofs']['maps'].keys.map{|path| "/etc/auto.master.d/#{path[1..-1].gsub(/\//,'_').downcase}.autofs"}
(delete - keep).each do |f|
file f do
action :delete
end
end
node['sys']['autofs']['maps'].each do |path, map|
name = path[1..-1].gsub(/\//,'_').downcase
template "/etc/auto.master.d/#{name}.autofs" do
......
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