22 lines
514 B
Python
22 lines
514 B
Python
# -*- mode: python; encoding: utf-8 -*-
|
|
|
|
info["owner"] = "root"
|
|
info["group"] = "root"
|
|
info["mode"] = 0644
|
|
|
|
comment_start = "#"
|
|
|
|
header("Services configuré sur la machine")
|
|
|
|
clients = metadata.query.all()
|
|
groups_dict = {}
|
|
|
|
for client in clients:
|
|
for group in client.groups:
|
|
groups_dict.setdefault(group, []).append(client.hostname.split('.', 1)[0])
|
|
|
|
out("services = {")
|
|
for (group_name, clients) in groups_dict.iteritems():
|
|
clients.sort()
|
|
out(" '%s': %s," % (group_name, clients))
|
|
out("}")
|