Skip to content

Instantly share code, notes, and snippets.

@KristianLyng
Created November 9, 2011 10:04
Show Gist options
  • Select an option

  • Save KristianLyng/1351011 to your computer and use it in GitHub Desktop.

Select an option

Save KristianLyng/1351011 to your computer and use it in GitHub Desktop.
; CHEF updated: <%= node[:bind][:timestamp_human] %>
$TTL 1800
@ IN SOA jupiter.bakabo.net. kristian.bakabo.net. (
<%= node[:bind][:timestamp] %> ; Serial
86400 ; Refresh
86400 ; Retry
2419200 ; Expire
120 ) ; Negative Cache TTL
;
@ IN NS jupiter.bakabo.net.
@ IN NS ns2.edgebone.net.
; Mail
@ IN MX 10 ASPMX.L.GOOGLE.COM.
@ IN MX 20 ALT1.ASPMX.L.GOOGLE.COM.
@ IN MX 20 ALT2.ASPMX.L.GOOGLE.COM.
@ IN MX 30 ASPMX2.GOOGLEMAIL.COM.
@ IN MX 30 ASPMX3.GOOGLEMAIL.COM.
@ IN MX 30 ASPMX4.GOOGLEMAIL.COM.
@ IN MX 30 ASPMX5.GOOGLEMAIL.COM.
;@ IN AAAA 2a02:20c8:1150:1100::a
;@ IN A 178.255.146.39
chef IN CNAME uranus.bakabo.net.
; CHEF-generated
<%
@nodes.each do |nod|
if nod.has_key?("customer")
foo=sprintf("%-15s\tIN\t%-4s\t%s\n",
nod[:hostname] + "." + nod[:customer] + ".customer",
"A",
nod[:ipaddress])
else
foo=sprintf("%-15s\tIN\t%-4s\t%s\n",
nod[:hostname],
"A",
nod[:ipaddress])
end
%><%= foo %><%
if nod.has_key?("ip6address")
if nod[:ip6address] != ""
if nod.has_key?("customer")
foo=sprintf("%-15s\tIN\t%-4s\t%s\n",
nod[:hostname] + "." + nod[:customer] + ".customer",
"AAAA",
nod[:ip6address])
else
foo=sprintf("%-15s\tIN\t%-4s\t%s\n",
nod[:hostname],
"AAAA",
nod[:ip6address])
end
%><%= foo %><%
end
end
end
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment