From 399fdb75308c5350d12e0c7c744ac7224b8b0386 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 5 Mar 2018 19:11:22 +0800 Subject: mail: create vmail group and user --- roles/mail/tasks/main.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/roles/mail/tasks/main.yml b/roles/mail/tasks/main.yml index b16059b..dbd1525 100644 --- a/roles/mail/tasks/main.yml +++ b/roles/mail/tasks/main.yml @@ -9,6 +9,40 @@ - dovecot - dovecot-pigeonhole +- name: group - check vmail group + command: pw groupshow vmail + register: pw_cmd + ignore_errors: true + changed_when: false + tags: vmail + +- name: group - create vmail group + command: pw groupadd vmail -g 5000 + when: pw_cmd.rc != 0 + tags: vmail + +- name: user - check vmail user + command: pw usershow vmail + register: pw_cmd + ignore_errors: true + changed_when: false + tags: vmail + +- name: user - create vmail user + command: > + pw useradd vmail + -u 5000 -g vmail + -m -M 0700 -d "/home/vmail" + -s /sbin/nologin + -c "Virtual Mail User" + when: pw_cmd.rc != 0 + tags: vmail + + +# +# OpenDKIM +# + - name: opendkim - create directory file: path: /usr/local/etc/mail/dkim -- cgit v1.2.2