Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Option to configure environment variables #61

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ dovecot_postfix_auth: false
dovecot_quota_options: ":ignoreunlimited:noenforcing"
dovecot_quota_storage: 1G

dovecot_userli_path: /vagrant
dovecot_userli_user: vagrant

dovecot_vmail_path: /var/vmail

dovecot_openmetrics_enabled: false
Expand All @@ -63,3 +60,8 @@ dovecot_backup_follower: false

# backup script
dovecot_backup_script_path: "/root/sync_mailboxes_to_remote.sh"

# dovecot systemd environment
dovecot_systemd_environment: |
# Set to '1' to allow Dovecot daemons to produce core dumps
#ALLOW_COREDUMPS=1
2 changes: 2 additions & 0 deletions files/systemd/system/dovecot.service.d/environment.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Service]
EnvironmentFile=/etc/default/dovecot
13 changes: 2 additions & 11 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
pkg: "{{ dovecot_apt_packages }}"
state: present

- name: Import systemd limits tasks
import_tasks: systemd-limits.yml
- name: Import systemd tasks
import_tasks: systemd.yml

- name: Ensure dovecot is in group of userli
user:
Expand All @@ -58,15 +58,6 @@
regexp: "login_greeting ="
notify: Restart dovecot

- name: Copy checkpassword auth config
template:
src: auth-checkpassword.conf.ext.j2
dest: /etc/dovecot/conf.d/auth-checkpassword.conf.ext
owner: root
group: root
mode: 0644
notify: Restart dovecot

- name: Create self-signed ssl cert
when: dovecot_ssl_key is not defined
block:
Expand Down
20 changes: 0 additions & 20 deletions tasks/systemd-limits.yml

This file was deleted.

41 changes: 41 additions & 0 deletions tasks/systemd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
- name: Create systemd drop in directory
file:
path: /etc/systemd/system/dovecot.service.d/
owner: root
group: root
mode: 0755
state: directory

- name: Copy systemd limits drop in
copy:
src: systemd/system/dovecot.service.d/limits.conf
dest: /etc/systemd/system/dovecot.service.d/limits.conf
owner: root
group: root
mode: 0644
notify:
- Reload systemd
- Restart dovecot

- name: Copy environment file
copy:
content: "{{ dovecot_systemd_environment }}"
dest: /etc/default/dovecot
owner: root
group: root
mode: 0640
notify:
- Reload systemd
- Restart dovecot

- name: Copy systemd environment drop in
copy:
src: systemd/system/dovecot.service.d/environment.conf
dest: /etc/systemd/system/dovecot.service.d/environment.conf
owner: root
group: root
mode: 0644
notify:
- Reload systemd
- Restart dovecot
19 changes: 0 additions & 19 deletions templates/auth-checkpassword.conf.ext.j2

This file was deleted.