ansible-role-mailserver/tasks/main.yml

69 lines
1.3 KiB
YAML
Raw Normal View History

2020-07-21 02:29:22 +02:00
---
- name: create vmail group
group:
name: vmail
gid: 5000
state: present
system: yes
- name: create vmail user
user:
name: vmail
uid: 5000
group: vmail
state: present
system: yes
shell: /usr/bin/nologin
home: /srv/mail
2020-07-22 23:20:10 +02:00
- name: get mx cert
notify: dehydrated
lineinfile:
path: /etc/dehydrated/domains.txt
line: "{{ mailserver_cert_domains }}"
2020-07-20 09:46:16 +02:00
- name: Run userdatabase
2020-07-24 18:08:57 +02:00
when: mailserver_dovecot_enabled or mailserver_roundcubemail_enabled
2020-07-20 09:46:16 +02:00
import_tasks: db.yml
2020-07-24 18:08:57 +02:00
tags:
- mail-db
- postfixadmin
- dovecot
- postfix
- roundcubemail
2020-07-20 09:46:16 +02:00
2020-07-22 19:51:50 +02:00
- name: Run postfixadmin
2020-07-24 12:42:59 +02:00
when: mailserver_dovecot_enabled
2020-07-22 19:51:50 +02:00
import_tasks: postfixadmin.yml
2020-07-24 17:07:52 +02:00
tags: postfixadmin
2020-07-22 19:51:50 +02:00
2020-07-20 09:46:16 +02:00
- name: Run dovecot
2020-07-24 12:42:59 +02:00
when: mailserver_dovecot_enabled
2020-07-20 09:46:16 +02:00
import_tasks: dovecot.yml
2020-07-24 17:07:52 +02:00
tags: dovecot
2020-07-20 09:46:16 +02:00
- name: Run rspamd
import_tasks: rspamd.yml
2020-07-22 23:20:10 +02:00
when: mailserver_rspamd_enabled
2020-07-24 17:07:52 +02:00
tags: rspamd
2020-07-20 09:46:16 +02:00
- name: Run mailman
2020-07-24 12:42:59 +02:00
when: mailserver_mailman_enabled
2020-07-20 09:46:16 +02:00
import_tasks: mailman.yml
2020-07-24 17:07:52 +02:00
tags: mailman
2020-07-20 09:46:16 +02:00
- name: Run postfix
import_tasks: postfix.yml
2020-07-24 17:07:52 +02:00
tags: postfix
- name: Run roundcubemail
when: mailserver_roundcubemail_enabled
import_tasks: roundcubemail.yml
tags: roundcubemail
2020-07-20 09:46:16 +02:00
2020-10-11 12:06:32 +02:00
- name: Run MX-Domain Website
when: mailserver_website != ""
import_tasks: website.yml
tags: website