## buildd.debian.org: grieg.debian.org::587 byname
<%=
-mxmatches = [ scope.lookupvar('::fqdn') ]
+mxmatches = [ @fqdn ]
routes = []
extraroutes = []
<%
rolehost={}
- localinfo = scope.lookupvar('site::localinfo')
allnodeinfo = scope.lookupvar('site::allnodeinfo')
+ roles = scope.lookupvar('site::roles')
%w{mailrelay nagiosmaster extranrpeclient muninmaster dbmaster static_mirror static_source static_master}.each do |role|
rolehost[role] = []
- localinfo.keys.sort.each do |node|
- if localinfo[node][role]
+ roles[role].each do |node|
rolehost[role] << allnodeinfo[node]['ipHostNumber']
- end
end
- rolehost[role].flatten!
+ rolehost[role].flatten!.sort.uniq
end
dbs = []
allow ^127\.0\.0\.1$
<%=
str = ''
-scope.lookupvar('site::localinfo').keys.sort.each do |node|
- if scope.lookupvar('site::localinfo')[node]['muninmaster']
+roles = scope.lookupvar('site::roles')
+roles['muninmaster'].each do |node|
scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].each do |ip|
str += "allow ^" + ip.split('.').join('\.') + "$\n"
end
- end
end
str
-%>
acl Nagios {
<%=
+ roles = scope.lookupvar('site::roles')
str = ''
- scope.lookupvar('site::localinfo').keys.sort.each do |node|
- if scope.lookupvar('site::localinfo')[node]['nagiosmaster']
+ roles['nagiosmaster'].each do |node|
scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].each do |ip|
str += "\t" + ip + "/32;\n"
end
- end
end
str-%>
};
<%=
-mirrors = []
-scope.lookupvar('site::localinfo').keys.sort.each do |node|
- if scope.lookupvar('site::localinfo')[node]['static_mirror']
- mirrors << node
- end
-end
+scope.lookupvar('site::roles')['static_mirror'].join("\n")
-
-mirrors.join("\n")
# vim:set et:
# vim:set sts=4 ts=4:
# vim:set shiftwidth=4:
return key
end
-localinfo = scope.lookupvar('site::localinfo')
allnodeinfo = scope.lookupvar('site::allnodeinfo')
+roles = scope.lookupvar('site::roles')
callers = []
-localinfo.keys.sort.each do |node|
- if localinfo[node]['static_mirror'] or localinfo[node]['static_source'] or localinfo[node]['static_master']
+
+%w{static_mirror static_source static_master}.each do |role|
+ roles[role].each do |node|
key = getstaticsynckey(node)
callers << { 'node' => node, 'addr' => allnodeinfo[node]['ipHostNumber'], 'key' => key}
end
return key
end
-localinfo = scope.lookupvar('site::localinfo')
allnodeinfo = scope.lookupvar('site::allnodeinfo')
+roles = scope.lookupvar('site::roles')
mirrors = []
-localinfo.keys.sort.each do |node|
- if localinfo[node]['weblog_provider']
+roles['weblog_provider'].each do |node|
key = getweblogsynckey(node)
mirrors << { 'node' => node, 'addr' => allnodeinfo[node]['ipHostNumber'], 'key' => key}
- end
end
lines = []