Add dbmail users management

This commit is contained in:
Antonio J. Delgado 2022-10-13 15:37:22 +03:00
parent f676acc307
commit 37486a5824
2 changed files with 20 additions and 1 deletions

View file

@ -0,0 +1,16 @@
---
- name: Ensure user accounts are present
shell: "dbmail-users -a {{ item.username }}"
loop: "{{ dbmail_users }}"
- name: Set user accounts password
shell: "dbmail-users -c {{ item.username }} -w {{ item.password}} -p {{ item.password_type | default('sha512') }}"
loop: "{{ dbmail_users }}"
- name: Link user accounts with emails
shell: "dbmail-users -c {{ item.username }} -s {{ item.email }}"
loop: "{{ dbmail_users }}"
- name: Set user accounts quota
shell: "dbmail-users -c {{ item.username }} -m {{ item.quota }}"
loop: "{{ dbmail_users }}"

View file

@ -18,3 +18,6 @@
- name: Ensure certificates are configured - name: Ensure certificates are configured
include_tasks: configure_certificates.yml include_tasks: configure_certificates.yml
when: dbmail_configuration['POP']['tls_port'] > 0 or dbmail_configuration['IMAP']['tls_port'] > 0 or dbmail_configuration['SIEVE']['tls_port'] > 0 when: dbmail_configuration['POP']['tls_port'] > 0 or dbmail_configuration['IMAP']['tls_port'] > 0 or dbmail_configuration['SIEVE']['tls_port'] > 0
- name: Ensure user's are configured in dbmail
include_tasks: configure_dbmail_users.yml