continue
generate_host(host, global_dir, accounts, ssh_userkeys)
-def generate_host(host, global_dir, accounts, ssh_userkeys):
+def generate_host(host, global_dir, all_accounts, ssh_userkeys):
current_host = host[1]['hostname'][0]
OutDir = global_dir + current_host + '/'
if not os.path.isdir(OutDir):
ExtraList[extra.upper()] = True
if GroupList != {}:
- accounts = filter(lambda x: IsInGroup(x, GroupList, current_host), accounts)
+ accounts = filter(lambda x: IsInGroup(x, GroupList, current_host), all_accounts)
DoLink(global_dir, OutDir, "debianhosts")
DoLink(global_dir, OutDir, "ssh_known_hosts")
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")
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: