def ExtractDNSInfo(x):
- DNSInfo = []
+ TTLprefix="\t"
+ if 'dnsTTL' in x[1]:
+ TTLprefix="%s\t"%(x[1]["dnsTTL"][0])
+ DNSInfo = []
if x[1].has_key("ipHostNumber"):
for I in x[1]["ipHostNumber"]:
if IsV6Addr.match(I) != None:
- DNSInfo.append("IN\tAAAA\t%s" % (I))
+ DNSInfo.append("%sIN\tAAAA\t%s" % (TTLprefix, I))
else:
- DNSInfo.append("IN\tA\t%s" % (I))
+ DNSInfo.append("%sIN\tA\t%s" % (TTLprefix, I))
Host = GetAttr(x, "hostname")
Arch = GetAttr(x, "architecture")
if Algorithm == None:
continue
Fingerprint = sha.new(base64.decodestring(Split[1])).hexdigest()
- DNSInfo.append("IN\tSSHFP\t%u 1 %s" % (Algorithm, Fingerprint))
+ DNSInfo.append("%sIN\tSSHFP\t%u 1 %s" % (TTLprefix, Algorithm, Fingerprint))
Mach = ""
if x[1].has_key("machine"):
Mach = " " + GetAttr(x, "machine")
- DNSInfo.append("IN\tHINFO\t\"%s%s\" \"%s\"" % (Arch, Mach, "Debian GNU/Linux"))
+ DNSInfo.append("%sIN\tHINFO\t\"%s%s\" \"%s\"" % (TTLprefix, Arch, Mach, "Debian GNU/Linux"))
if x[1].has_key("mXRecord"):
for I in x[1]["mXRecord"]:
- DNSInfo.append("IN\tMX\t%s" % (I))
+ DNSInfo.append("%sIN\tMX\t%s" % (TTLprefix, I))
return DNSInfo
# Fetch all the hosts
HostAttrs = l.search_s(HostBaseDn, ldap.SCOPE_ONELEVEL, "objectClass=debianServer",\
["hostname", "sshRSAHostKey", "purpose", "allowedGroups", "exportOptions",\
- "mXRecord", "ipHostNumber", "machine", "architecture"])
+ "mXRecord", "ipHostNumber", "dnsTTL", "machine", "architecture"])
if HostAttrs == None:
raise UDEmptyList, "No Hosts"
"exportOptions": ["Export-Opts", 18],
"ipHostNumber": ["IP Address", 19],
"mXRecord": ["MXRecord", 20],
- "sshdistAuthKeysHost": ["extra authkeys ip", 21],
+ "dnsTTL": ["dnsTTL", 21],
+ "sshdistAuthKeysHost": ["extra authkeys ip", 22],
}
AttrPrompt = {"description": ["Purpose of the machine"],
"exportOptions": ["additional export options"],
"ipHostNumber": ["IP Addresses(es) of the machine"],
"mXRecord": ["Mail Exchanger for this machine"],
+ "dnsTTL": ["dns TTL value"],
"sshdistAuthKeysHost": ["additional hosts for sshdist's authkeys file"],
};
# .39 - allowedGroups
# .40 - exportOptions
# .41 - sshdistAuthKeysHost
+# .42 - dnsTTL
#
# .3 - experimental LDAP objectClasses
# .1 - debianDeveloper
NAME ( 'sshdistAuthKeysHost' )
SUP ipHostNumber )
+attributetype ( 1.3.6.1.4.1.9586.100.4.4.42
+ NAME 'dnsTTL'
+ DESC 'DNS Time To Live value'
+ EQUALITY caseIgnoreIA5Match
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
# Public object classes
MUST ( host $ hostname )
MAY ( c $ access $ admin $ architecture $ bandwidth $ description $ disk $
distribution $ l $ machine $ memory $ sponsor $
- sponsor-admin $ status $ physicalHost $ ipHostNumber $
+ sponsor-admin $ status $ physicalHost $ ipHostNumber $ dnsTTL $
sshRSAHostKey $ purpose $ allowedGroups $ exportOptions $ MXRecord $
sshdistAuthKeysHost
) )