Project

General

Profile

« Previous | Next » 

Revision 766c702c

Added by Marc Dequènes about 14 years ago

  • ID 766c702c85f14b083d61f473066618b20c75db61

[evol] quick code to handle running an external script to reload the zone (needed for signed zones)

View differences:

data/cyborghood/schema/postman.yaml
type: map
mapping:
"master_zone_pattern": {type: str, required: yes}
"update_zone_script": {type: str}
lib/cyborghood/services/dns.rb
end
def serial
# TODO: use a factory
case @config.dns.nameserver || :bind
when :bind
output = []
......
end
def check_zone_file(filename)
# TODO: use a factory
case @config.dns.nameserver || :bind
when :bind
output = []
......
end
def reload_zone
system "sudo rndc reload '#{@zone}' >/dev/null"
script = @config.dns.update_zone_script
if script.nil?
case @config.dns.nameserver || :bind
when :bind
script = "rndc reload"
else
# TODO: should be checked at startup time
raise CyberError.new(:unrecoverable, "services/dns", "erroneous configuration: unknown nameserver")
end
end
system "sudo #{script} '#{@zone}' >/dev/null"
end
private

Also available in: Unified diff