Create the mailman home directory separately with the correct permissions.

This commit is contained in:
Andrea Dell'Amico 2020-02-11 17:41:12 +01:00
parent fecdbb32f5
commit 78435d2526
1 changed files with 8 additions and 2 deletions

View File

@ -13,7 +13,10 @@
- name: Create the mailman user - name: Create the mailman user
block: block:
- name: mailman user - name: mailman user
user: name={{ mailman_srv_user }} createhome=yes shell=/bin/bash system=yes comment='Mailman User' generate_ssh_key=yes home={{ mailman_home }} user: name={{ mailman_srv_user }} createhome=no shell=/usr/sbin/nologin system=yes comment='Mailman User' generate_ssh_key=yes home={{ mailman_home }}
- name: Create the mailman user directory
file: dest={{ mailman_home }} state=directory mode=0755 owner={{ mailman_srv_user }} group={{ mailman_srv_user }}
when: ansible_distribution_file_variety == "RedHat" when: ansible_distribution_file_variety == "RedHat"
tags: [ 'mailman' ] tags: [ 'mailman' ]
@ -74,6 +77,9 @@
- 'alembic' - 'alembic'
- 'mailman' - 'mailman'
- name: Create the tmpfile entry for the mailman lock directory
template: src=tmpfile_mailman.conf.j2 dest=/lib/tmpfiles.d/mailman.conf owner=root group=root mode=0644
- name: Install the mailman startup unit - name: Install the mailman startup unit
template: src=mailman.service.systemd.j2 dest=/lib/systemd/system/mailman.service owner=root group=root mode=0644 template: src=mailman.service.systemd.j2 dest=/lib/systemd/system/mailman.service owner=root group=root mode=0644
register: mailman_unit_install register: mailman_unit_install
@ -87,7 +93,7 @@
- name: Restart mailman if the configuration changed - name: Restart mailman if the configuration changed
service: name=mailman state=restarted service: name=mailman state=restarted
when: mailman_conf_install | bool when: mailman_conf_install is changed
tags: [ 'mailman', 'mailman_conf' ] tags: [ 'mailman', 'mailman_conf' ]