LXC configuration + useful hooks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
lxc-config/hooks/templates/dn42-zone.erb

40 lines
1.4 KiB

<% if data["zone"]["ttl"] -%>
$TTL <%= data["zone"]["ttl"] %>
<% end -%>
@ IN SOA <%= data["zone"]["soa"] %> <%= data["zone"]["hostmaster"] %> (
<%= data["zone"]["serial"] %> ; serial
<%= data["zone"]["refresh"] %> ; refresh
<%= data["zone"]["retry"] %> ; retry
<%= data["zone"]["expire"] %> ; expire
<%= data["zone"]["minimum"] %>) ; minimum
<% data["zone"]["ns"].each do |name, value| -%>
NS <%= name %>.
<% end -%>
<% if data["zone"]["a"] -%>
A <%= data["zone"]["dn42-a"] %>
<% end -%>
<% if data["zone"]["aaaa"] -%>
AAAA <%= data["zone"]["dn42-aaaa"]%>
<% end -%>
<% data["network"].each do |name, value| %>
<% if value["cname"] -%>
<%= fqdn(name) %> CNAME <%= value["cname"] %>
<% end -%>
<% if value["srv"] -%>
<%= fqdn(name) %> SRV <%= value["srv"] %>
<% end -%>
<% if value["ipv4"] -%>
<%= fqdn(name) %> A <%= NetAddr::CIDR.create(value["ipv4"]).ip(Short: true) %>
ipv4.<%= fqdn(name) %> A <%= NetAddr::CIDR.create(value["ipv4"]).ip(Short: true) %>
<% end -%>
<% if value["ula"] -%>
<%= fqdn(name) %> AAAA <%= NetAddr::CIDR.create(value["ula"]).ip(Short: true) %>
ula.<%= fqdn(name) %> AAAA <%= NetAddr::CIDR.create(value["ula"]).ip(Short: true) %>
<% end -%>
<% if value["ipv6"] -%>
ipv6.<%= fqdn(name) %> AAAA <%= NetAddr::CIDR.create(value["ipv6"]).ip(Short: true) %>
<% end -%>
<% end -%>