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, ''))
source_url ''
issues_url ''
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']{|path| "/etc/auto.master.d/#{path[1..-1].gsub(/\//,'_').downcase}.autofs"}
(delete - keep).each do |f|
file f do
action :delete
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