diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2013-11-27 01:26:36 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2015-06-07 02:50:57 +0200 |
commit | 3d8b0ac104dee68b47d9a4d2ef622e7f1acdd7a4 (patch) | |
tree | 3de7324399fdc31ee6f946ffddc613d7742fa3d0 | |
parent | a03f59d589e65366fb0194534cb6aa2a36176bc4 (diff) |
Reorganization.
-rw-r--r-- | common.yml | 24 | ||||
-rw-r--r-- | group_vars/all.yml (renamed from vars.yml) | 0 | ||||
-rw-r--r-- | roles/common-LDAP/files/etc/ldap/schema/fripost.ldif (renamed from roles/common/files/etc/ldap/schema/fripost.ldif) | 0 | ||||
-rw-r--r-- | roles/common-LDAP/files/var/lib/ldap/fripost/DB_CONFIG (renamed from roles/common/files/var/lib/ldap/fripost/DB_CONFIG) | 0 | ||||
-rw-r--r-- | roles/common-LDAP/handlers/main.yml | 2 | ||||
-rw-r--r-- | roles/common-LDAP/tasks/main.yml (renamed from roles/common/tasks/ldap.yml) | 0 | ||||
-rw-r--r-- | roles/common-LDAP/templates/etc/ldap/database.ldif.j2 (renamed from roles/common/templates/etc/ldap/database.ldif.j2) | 0 | ||||
-rw-r--r-- | roles/common-SQL/tasks/main.yml (renamed from roles/common/tasks/sql.yml) | 0 | ||||
-rw-r--r-- | roles/common/handlers/main.yml | 3 | ||||
-rw-r--r-- | roles/common/tasks/main.yml | 12 |
10 files changed, 24 insertions, 17 deletions
@@ -1,7 +1,27 @@ --- +# XXX: This organization is unfortunate. As of Ansible 1.4, roles are +# applied playbook by playbook and not globally for the whole inventory; +# therefore if two playbooks are given the role 'common', the tasks +# defined in 'common' would be run twice. +# The quickfix to ensure that plays are role-disjoint is to create a +# separate play for each role. Of course the downside is that we loose +# (most of) the advantage of roles... + - name: Common tasks hosts: all - vars_files: - - vars.yml roles: - common + +- name: Common SQL tasks + hosts: MDA:webmail:backup + gather_facts: False + tags: mysql,sql + roles: + - common-SQL + +- name: Common LDAP tasks + hosts: MDA:MSA:lists:LDAP-producer:MX + gather_facts: False + tags: slapd,ldap + roles: + - common-LDAP diff --git a/vars.yml b/group_vars/all.yml index 2cd3a42..2cd3a42 100644 --- a/vars.yml +++ b/group_vars/all.yml diff --git a/roles/common/files/etc/ldap/schema/fripost.ldif b/roles/common-LDAP/files/etc/ldap/schema/fripost.ldif index 851988e..851988e 100644 --- a/roles/common/files/etc/ldap/schema/fripost.ldif +++ b/roles/common-LDAP/files/etc/ldap/schema/fripost.ldif diff --git a/roles/common/files/var/lib/ldap/fripost/DB_CONFIG b/roles/common-LDAP/files/var/lib/ldap/fripost/DB_CONFIG index 0bd4e58..0bd4e58 100644 --- a/roles/common/files/var/lib/ldap/fripost/DB_CONFIG +++ b/roles/common-LDAP/files/var/lib/ldap/fripost/DB_CONFIG diff --git a/roles/common-LDAP/handlers/main.yml b/roles/common-LDAP/handlers/main.yml new file mode 100644 index 0000000..6972af2 --- /dev/null +++ b/roles/common-LDAP/handlers/main.yml @@ -0,0 +1,2 @@ +- name: Restart slapd + service: name=slapd state=restarted diff --git a/roles/common/tasks/ldap.yml b/roles/common-LDAP/tasks/main.yml index cb1e835..cb1e835 100644 --- a/roles/common/tasks/ldap.yml +++ b/roles/common-LDAP/tasks/main.yml diff --git a/roles/common/templates/etc/ldap/database.ldif.j2 b/roles/common-LDAP/templates/etc/ldap/database.ldif.j2 index 19fcdd0..19fcdd0 100644 --- a/roles/common/templates/etc/ldap/database.ldif.j2 +++ b/roles/common-LDAP/templates/etc/ldap/database.ldif.j2 diff --git a/roles/common/tasks/sql.yml b/roles/common-SQL/tasks/main.yml index e32c863..e32c863 100644 --- a/roles/common/tasks/sql.yml +++ b/roles/common-SQL/tasks/main.yml diff --git a/roles/common/handlers/main.yml b/roles/common/handlers/main.yml index 51b19f7..54643ed 100644 --- a/roles/common/handlers/main.yml +++ b/roles/common/handlers/main.yml @@ -35,6 +35,3 @@ - name: Reload Postfix service: name=postfix state=reloaded - -- name: Restart slapd - service: name=slapd state=restarted diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index ed84cb5..355b2df 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -9,15 +9,3 @@ - include: ipsec.yml tags=strongswan,ipsec - include: logging.yml tags=logging - include: mail.yml tags=mail,postfix -- include: sql.yml tags=mysql,sql - # XXX: the conditional here is a bit dirty, because it clutters the - # output with 'skipping' notices. - when: "'MDA' in group_names or - 'webmail' in group_names or - 'backup' in group_names" -- include: ldap.yml tags=slapd,ldap - when: "'MDA' in group_names or - 'MSA' in group_names or - 'lists' in group_names or - 'LDAP-producer' in group_names or - 'MX' in group_names" |