diff options
author | Aaron LI <aly@aaronly.me> | 2018-03-05 19:57:25 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2018-03-14 11:35:08 +0800 |
commit | fb9e90d84ab1eb50c6f0702316a67bcad6db8524 (patch) | |
tree | 84492a7f195626a07ac566de343b957c7ae5150e /roles | |
parent | d9b877957c52789e494aeee1ffd4d3128dd9e597 (diff) | |
download | ansible-dfly-vps-fb9e90d84ab1eb50c6f0702316a67bcad6db8524.tar.bz2 |
vars: add "mail.user" for the virtual mail user info
Diffstat (limited to 'roles')
-rw-r--r-- | roles/mail/tasks/main.yml | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/roles/mail/tasks/main.yml b/roles/mail/tasks/main.yml index 8bf6ff3..8191c0d 100644 --- a/roles/mail/tasks/main.yml +++ b/roles/mail/tasks/main.yml @@ -10,19 +10,19 @@ - dovecot-pigeonhole - name: group - check vmail group - command: pw groupshow vmail + command: pw groupshow {{ mail.user.name }} register: pw_cmd ignore_errors: true changed_when: false tags: vmail - name: group - create vmail group - command: pw groupadd vmail -g 5000 + command: pw groupadd {{ mail.user.name }} -g {{ mail.user.id }} when: pw_cmd.rc != 0 tags: vmail - name: user - check vmail user - command: pw usershow vmail + command: pw usershow {{ mail.user.name }} register: pw_cmd ignore_errors: true changed_when: false @@ -30,9 +30,9 @@ - name: user - create vmail user command: > - pw useradd vmail - -u 5000 -g vmail - -m -M 0700 -d "/home/vmail" + pw useradd {{ mail.user.name }} + -u {{ mail.user.id }} -g {{ mail.user.name }} + -m -M 0700 -d {{ mail.user.home }} -s /sbin/nologin -c "Virtual Mail User" when: pw_cmd.rc != 0 |