make it possible to disable inclusions and split out mailer role

This commit is contained in:
Farhad Shahbazi
2016-11-24 16:36:45 +01:00
parent 3ed4105c79
commit 75fcfd3a0e
4 changed files with 30 additions and 20 deletions

13
tasks/mailer.yml Normal file
View File

@@ -0,0 +1,13 @@
---
- name: /etc/mailname
copy: dest=/etc/mailname content="{{ common_mailname }}\n" owner=root group=root mode=0644
notify: restart mailer
- name: /etc/aliases
template: dest=/etc/aliases src=aliases.j2 owner=root group=root mode=0644
notify:
- newaliases
- restart mailer
- include: "{{ common_mailer_mailer }}.yml"
when: common_mailer_mailer != False

View File

@@ -1,6 +1,6 @@
---
- include: resolvconf.yml
when: common_resolvconf
tags: ['common', 'resolvconf']
- include: hostname.yml
@@ -8,6 +8,7 @@
tags: ['common', 'hostname']
- include: apt.yml
when: common_apt
tags: ['common', 'apt']
- include: locales.yml
@@ -24,30 +25,18 @@
with_items: "{{ common_scripts }}"
tags: common
- name: /etc/mailname
copy: dest=/etc/mailname content="{{ common_mailname }}\n" owner=root group=root mode=0644
notify: restart mailer
when: common_mailer != False
tags: ['common', 'mailer']
- name: /etc/aliases
template: dest=/etc/aliases src=aliases.j2 owner=root group=root mode=0644
notify:
- newaliases
- restart mailer
when: common_mailer != False
- include: mailer.yml
when: common_mailer
tags: ['common', 'mailer']
- include: ntp.yml
when: common_ntp
tags: ['common', 'ntp']
- include: openssh.yml
when: common_openssh
tags: ['common', 'openssh']
- include: rsyslog.yml
when: common_rsyslog
tags: ['common', 'rsyslog']
- include: "{{ common_mailer }}.yml"
when: common_mailer != False
tags: ['common', 'mailer']