summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2014-07-02 18:37:50 +0200
committerGuilhem Moulin <guilhem@fripost.org>2015-06-07 02:52:16 +0200
commita9af50cc3e54389281caa0a353ddf82e10069425 (patch)
tree3e53bcc3a662aeb94367993ee71ace21c7195e80 /roles
parentaa6628dd67914c2849781cfb738c7389434c9608 (diff)
Don't auto-create home directories when adding system users.
Unlike adduser(8), ansible's 'user' module copies skeletal configuration files even for system users (unless called with createhome=no).
Diffstat (limited to 'roles')
-rw-r--r--roles/IMAP-proxy/tasks/main.yml1
-rw-r--r--roles/IMAP/tasks/imap.yml1
-rw-r--r--roles/lists/tasks/mlmmj.yml1
3 files changed, 3 insertions, 0 deletions
diff --git a/roles/IMAP-proxy/tasks/main.yml b/roles/IMAP-proxy/tasks/main.yml
index 73a0dee..41bb7a3 100644
--- a/roles/IMAP-proxy/tasks/main.yml
+++ b/roles/IMAP-proxy/tasks/main.yml
@@ -1,29 +1,30 @@
- name: Install Dovecot
#apt: pkg={{ item }} default_release={{ ansible_lsb.codename }}-backports
apt: pkg={{ item }}
with_items:
- dovecot-core
- dovecot-imapd
- name: Create a user 'imapproxy'
user: name=imapproxy system=yes
+ createhome=no
home=/home/imapproxy
shell=/bin/false
password=!
state=present
- name: Create a home directory for user 'imapproxy'
file: path=/home/imapproxy
state=directory
owner=imapproxy group=imapproxy
mode=0700
- name: Configure Dovecot
copy: src=etc/dovecot/conf.d/{{ item }}
dest=/etc/dovecot/conf.d/{{ item }}
owner=root group=root
mode=0644
register: r
with_items:
- 10-auth.conf
- 10-logging.conf
diff --git a/roles/IMAP/tasks/imap.yml b/roles/IMAP/tasks/imap.yml
index be451ef..aadcb6e 100644
--- a/roles/IMAP/tasks/imap.yml
+++ b/roles/IMAP/tasks/imap.yml
@@ -1,33 +1,34 @@
- name: Install Dovecot
apt: pkg={{ item }}
with_items:
- dovecot-core
- dovecot-ldap
- dovecot-imapd
- dovecot-lmtpd
- dovecot-antispam
- dovecot-managesieved
- dovecot-sieve
- name: Create a user 'vmail'
user: name=vmail system=yes
+ createhome=no
home=/home/mail
shell=/bin/false
password=!
state=present
# Required for dbox, see
# http://wiki2.dovecot.org/MailboxFormat/dbox#Multi-dbox
- name: Create a nightly cron job to purge expunged messages
cron: name="Purge expunged messages"
minute=7 hour=5
user=vmail cron_file=doveadm-purge
job="/usr/bin/doveadm purge -A"
# The ownership and permissions ensure that dovecot won't try to
# deliver mails under an umounted mountpoint.
- name: Create a home directory for user 'vmail'
file: path=/home/mail
state=directory
owner=root group=root
mode=0755
diff --git a/roles/lists/tasks/mlmmj.yml b/roles/lists/tasks/mlmmj.yml
index 5944e57..51d779f 100644
--- a/roles/lists/tasks/mlmmj.yml
+++ b/roles/lists/tasks/mlmmj.yml
@@ -1,28 +1,29 @@
- name: Install MLMMJ
apt: pkg={{ item }}
with_items:
- mlmmj
# Weird the debian package doesn't do it by itself...
- name: Create a user 'mlmmj'
user: name=mlmmj system=yes
+ createhome=no
home=/var/spool/mlmmj
shell=/bin/false
password=!
state=present
- name: Add 'www-data' to the group 'mlmmj'
user: name=www-data groups=mlmmj append=yes
- name: Create a home directory for user 'mlmmj'
file: path=/var/spool/mlmmj
state=directory
owner=mlmmj group=mlmmj
mode=0700
- name: Create /var/lib/mlmmj
file: path=/var/lib/mlmmj
state=directory
owner=mlmmj group=mlmmj
mode=0750