lxc-zone: handle SRV-records

This commit is contained in:
Jörg Thalheim 2015-01-03 17:57:39 +01:00
parent acf532809a
commit 655cdbb427
2 changed files with 24 additions and 18 deletions

View File

@ -21,7 +21,6 @@ def atomic_write(path, content)
FileUtils.mv(temp_path, path) FileUtils.mv(temp_path, path)
end end
class ZoneData class ZoneData
def initialize(data) def initialize(data)
@data = data @data = data
@ -59,6 +58,7 @@ class RdnsData
end end
end end
def main
json = JSON.load(File.open(CONTAINER_DATA)) json = JSON.load(File.open(CONTAINER_DATA))
json["zone"]["serial"] += 1 json["zone"]["serial"] += 1
@ -82,3 +82,6 @@ atomic_write(v6_rdns_path, v6_rdns_zone)
atomic_write(CONTAINER_DATA, JSON.pretty_generate(json)) atomic_write(CONTAINER_DATA, JSON.pretty_generate(json))
system("lxc-attach", "-e", "-n", DNS_CONTAINER, "--", "rec_control", "reload-zones") system("lxc-attach", "-e", "-n", DNS_CONTAINER, "--", "rec_control", "reload-zones")
end
main

View File

@ -10,6 +10,9 @@
<% if value["cname"] -%> <% if value["cname"] -%>
<%= name %> CNAME <%= value["cname"] %> <%= name %> CNAME <%= value["cname"] %>
<% end -%> <% end -%>
<% if value["srv"] -%>
<%= name %> SRV <%= value["srv"] %>
<% end -%>
<% if value["ipv4"] -%> <% if value["ipv4"] -%>
<%= name %> A <%= ip(value["ipv4"]) %> <%= name %> A <%= ip(value["ipv4"]) %>
ipv4.<%= name %> A <%= ip(value["ipv4"]) %> ipv4.<%= name %> A <%= ip(value["ipv4"]) %>