packmail: use role dependencies instead of include_role

This commit is contained in:
Victor LABORIE 2017-10-10 16:13:12 +02:00
parent 0640a9f8fd
commit a6499b6712
3 changed files with 24 additions and 53 deletions

7
packmail/meta/main.yml Normal file
View file

@ -0,0 +1,7 @@
---
dependencies:
- { role: ldap, ldap_schema: 'cn4evolix.ldif' }
- { role: postfix }
- { role: dovecot }
- { role: apache }
- { role: php, php_apache_enable: True }

View file

@ -1,21 +0,0 @@
---
- name: Additional packages are installed
apt:
name: '{{ item }}'
state: present
with_items:
- libapache2-mod-security2
- modsecurity-crs
- apg
- name: Additional modules are enabled
apache2_module:
name: '{{ item }}'
state: present
with_items:
- ssl
- include
- negotiation
- alias

View file

@ -1,42 +1,27 @@
---
- fail:
msg: only compatible with Debian >= 9
when:
- ansible_distribution != "Debian" or ansible_distribution_major_version | version_compare('9', '<')
- name: Include ldap role
include_role:
name: ldap
- name: Additional packages are installed
apt:
name: '{{ item }}'
state: present
with_items:
- libapache2-mod-security2
- modsecurity-crs
- apg
- name: upload evolix schema
copy:
src: cn4evolix.ldif
dest: /root/cn4evolix.ldif
mode: "0640"
- name: inject evolix schema
command: ldapadd -Y EXTERNAL -H ldapi:/// -f /root/cn4evolix.ldif
- name: Include postfix role
include_role:
name: postfix
- name: Include dovecot role
include_role:
name: dovecot
- name: Include apache role
include_role:
name: apache
- name: Include PHP role
include_role:
name: php
vars:
php_apache_enable: True
- include: apache.yml
- name: Additional modules are enabled
apache2_module:
name: '{{ item }}'
state: present
with_items:
- ssl
- include
- negotiation
- alias
- name: Install Evoadmin
include_role: