summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2014-03-21 22:14:10 +0000
committerAurélien Bompard <aurelien@bompard.org>2014-03-22 14:43:47 +0000
commit188978aad60d86804d57f857c7c1db40de81fa8e (patch)
tree0150c01098bb22c2405def8a1e48f9de7f713e9f
parent750c09b4c9559461c890bea6270bce7cbd3f40a9 (diff)
downloadansible-188978aad60d86804d57f857c7c1db40de81fa8e.tar.gz
ansible-188978aad60d86804d57f857c7c1db40de81fa8e.tar.xz
ansible-188978aad60d86804d57f857c7c1db40de81fa8e.zip
Mailman: fix pg_hba perms and improve import script
-rw-r--r--playbooks/hosts/lists-dev.cloud.fedoraproject.org.yml1
-rwxr-xr-xroles/mailman/files/import-mm2.py8
2 files changed, 8 insertions, 1 deletions
diff --git a/playbooks/hosts/lists-dev.cloud.fedoraproject.org.yml b/playbooks/hosts/lists-dev.cloud.fedoraproject.org.yml
index ab463ee83..ade438704 100644
--- a/playbooks/hosts/lists-dev.cloud.fedoraproject.org.yml
+++ b/playbooks/hosts/lists-dev.cloud.fedoraproject.org.yml
@@ -63,6 +63,7 @@
creates=/var/lib/pgsql/data/postgresql.conf
- name: copy pg_hba.conf
copy: src="{{ files }}/lists-dev/pg_hba.conf" dest=/var/lib/pgsql/data/pg_hba.conf
+ owner=postgres group=postgres
notify:
- restart postgresql
- name: start postgresql
diff --git a/roles/mailman/files/import-mm2.py b/roles/mailman/files/import-mm2.py
index 2afa10c5f..15a01fa36 100755
--- a/roles/mailman/files/import-mm2.py
+++ b/roles/mailman/files/import-mm2.py
@@ -23,10 +23,11 @@ class Importer(object):
def __init__(self, opts, config):
self.opts = opts
self.config = config
+ self.index_path = self._get_index_path()
self.existing_lists = [ l.strip() for l in
cmdget(["sudo", "-u", "mailman",
"mailman3", "lists", "-q"]).split("\n") ]
- self.index_path = self._get_index_path()
+ self.excluded = opts.exclude.strip().split(",")
def _get_index_path(self):
sys.path.append(self.config["confdir"])
@@ -41,6 +42,9 @@ class Importer(object):
all_listnames.sort()
for index, listname in enumerate(all_listnames):
listaddr = "%s@%s" % (listname, self.config["domain"])
+ if listname in self.excluded or listaddr in self.excluded:
+ print "Skipping excluded list %s" % listaddr
+ continue
print listaddr, "(%d/%d)" % (index+1, len(all_listnames))
confpickle = os.path.join(mm2libdir, 'lists', listname,
'config.pck')
@@ -84,6 +88,8 @@ def main():
help="Don't import the archives, only import the list config")
parser.add_option("-c", "--config", default="/etc/mailman-migration.conf",
help="Configuration file (default: %defaults)")
+ parser.add_option("-x", "--exclude", default="",
+ help="Comma-separated list of lists to exclude")
opts, args = parser.parse_args()
if len(args) != 1:
parser.error("Only one arg: the Mailman 2.1 lib dir to import")