Commit 0ea1792f authored by Lucas Nussbaum's avatar Lucas Nussbaum

[dev/bind] clean old zone files before generation

parent d7f1a705
Pipeline #60204 passed with stages
in 1 minute and 41 seconds
# See also:
require 'dns/zone'
require 'find'
#Prettier aligned dump of records
class DNS::Zone::RR::A
......@@ -436,6 +437,15 @@ def generate_puppet_bindg5k(options)
dest_dir = "#{$options[:output_dir]}/platforms/production/modules/generated/files/bind/"
zones_dir = File.join(dest_dir, "zones/#{site_uid}")
# Cleanup of old zone files
Find.find(zones_dir) do |path|
next if not File::file?(path)
next if path =~ /manual/ # skip *manual* files
# FIXME those files are not named *manual*, but should not be removed
next if ['nancy-laptops.db', 'toulouse-servers.db', 'toulouse.db'].include?(File::basename(path))
site_records = {}
# Servers
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