aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-03-05 19:11:22 +0800
committerAaron LI <aly@aaronly.me>2018-03-14 11:35:08 +0800
commit399fdb75308c5350d12e0c7c744ac7224b8b0386 (patch)
tree060c4688ef8ed516704ca039248d774b53ed61b7
parentd6a4f14be9e45cf3d883ee90de90d548ca1f0d5e (diff)
downloadansible-dfly-vps-399fdb75308c5350d12e0c7c744ac7224b8b0386.tar.bz2
mail: create vmail group and user
-rw-r--r--roles/mail/tasks/main.yml34
1 files changed, 34 insertions, 0 deletions
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