Fix cleanup services with roundcube_separate_user enabled
This commit is contained in:
parent
136668e71f
commit
576261919f
3 changed files with 34 additions and 2 deletions
3
handlers/main.yml
Normal file
3
handlers/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
- name: reload systemd
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
daemon_reload: True
|
||||||
|
|
@ -21,6 +21,33 @@
|
||||||
create_home: false
|
create_home: false
|
||||||
system: true
|
system: true
|
||||||
|
|
||||||
|
- name: Create directories for systemd drop-ins
|
||||||
|
when: roundcube_separate_user
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: '/etc/systemd/system/{{ item }}.d'
|
||||||
|
state: directory
|
||||||
|
loop:
|
||||||
|
- roundcube-gc.service
|
||||||
|
- roundcube-cleandb.service
|
||||||
|
|
||||||
|
- name: Create systemd drop-ins to use separate user
|
||||||
|
when: roundcube_separate_user
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: 10-separate-user.conf.j2
|
||||||
|
dest: '/etc/systemd/system/{{ item }}'
|
||||||
|
loop: &roundcube_separate_user_dropins
|
||||||
|
- roundcube-gc.service.d/10-separate-user.conf
|
||||||
|
- roundcube-cleandb.service.d/10-separate-user.conf
|
||||||
|
notify: reload systemd
|
||||||
|
|
||||||
|
- name: Remove systemd drop-ins to use separate user
|
||||||
|
when: not roundcube_separate_user
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: '/etc/systemd/system/{{ item }}'
|
||||||
|
state: absent
|
||||||
|
loop: *roundcube_separate_user_dropins
|
||||||
|
notify: reload systemd
|
||||||
|
|
||||||
# php_version and "restart php-fpm" handler from nginx role
|
# php_version and "restart php-fpm" handler from nginx role
|
||||||
- name: Create roundcube php pool
|
- name: Create roundcube php pool
|
||||||
when: roundcube_separate_user
|
when: roundcube_separate_user
|
||||||
|
|
@ -30,8 +57,7 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
notify:
|
notify: restart php-fpm
|
||||||
- restart php-fpm
|
|
||||||
|
|
||||||
- name: Create db directory
|
- name: Create db directory
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
|
|
|
||||||
3
templates/10-separate-user.conf.j2
Normal file
3
templates/10-separate-user.conf.j2
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
[Service]
|
||||||
|
User=roundcube
|
||||||
|
Group=roundcube
|
||||||
Loading…
Add table
Add a link
Reference in a new issue