X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=ud-generate;h=a2b28f94d844957a512b85eea72626f905ce924c;hb=76b0b3995616eae1e623593077ee348d550cf742;hp=e68acdc34a8b26aea261e87c1fb3daff3c76fe97;hpb=d820c6244409227e8126a671c14c16e4e1a7919e;p=mirror%2Fuserdir-ldap.git diff --git a/ud-generate b/ud-generate index e68acdc..a2b28f9 100755 --- a/ud-generate +++ b/ud-generate @@ -71,6 +71,7 @@ isSSHFP = re.compile("^\s*IN\s+SSHFP") DNSZone = ".debian.net" Keyrings = ConfModule.sync_keyrings.split(":") GitoliteSSHRestrictions = getattr(ConfModule, "gitolitesshrestrictions", None) +MX_remap = json.loads(ConfModule.MX_remap) def prettify(elem): """Return a pretty-printed XML string for the Element. @@ -855,7 +856,11 @@ def ExtractDNSInfo(x): if x[1].has_key("mXRecord"): for I in x[1]["mXRecord"]: - DNSInfo.append("%sIN\tMX\t%s" % (TTLprefix, I)) + if I in MX_remap: + for e in MX_remap[I]: + DNSInfo.append("%sIN\tMX\t%s" % (TTLprefix, e)) + else: + DNSInfo.append("%sIN\tMX\t%s" % (TTLprefix, I)) return DNSInfo @@ -1260,6 +1265,12 @@ def generate_host(host, global_dir, all_accounts, ssh_userkeys): if 'GITOLITE' in ExtraList: DoLink(global_dir, OutDir, "ssh-gitolite") + if 'exportOptions' in host[1]: + for entry in host[1]['exportOptions']: + v = entry.split('=',1) + if v[0] != 'GITOLITE' or len(v) != 2: continue + gitolite_accounts = filter(lambda x: IsInGroup(x, [v[1]], current_host), all_accounts) + GenSSHGitolite(gitolite_accounts, OutDir + "ssh-gitolite-%s"%(v[1],)) if 'WEB-PASSWORDS' in ExtraList: DoLink(global_dir, OutDir, "web-passwords") @@ -1339,7 +1350,7 @@ def ud_generate(): parser.add_option("-g", "--generatedir", dest="generatedir", metavar="DIR", help="Output directory.") parser.add_option("-f", "--force", dest="force", action="store_true", - help="Force generation, even if not update to LDAP has happened.") + help="Force generation, even if no update to LDAP has happened.") (options, args) = parser.parse_args() if len(args) > 0: