aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/dovecot
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/dovecot')
-rw-r--r--ansible/roles/dovecot/tasks/main.yml20
1 files changed, 20 insertions, 0 deletions
diff --git a/ansible/roles/dovecot/tasks/main.yml b/ansible/roles/dovecot/tasks/main.yml
new file mode 100644
index 0000000..1ee3b8d
--- /dev/null
+++ b/ansible/roles/dovecot/tasks/main.yml
@@ -0,0 +1,20 @@
+- tags:
+ - dovecot
+ - packages
+ become: yes
+ apt:
+ name: python-passlib
+ install_recommends: no
+
+- tags:
+ - dovecot
+ - update-passwords
+ become: yes
+ with_dict: "{{ dovecot__passwords }}"
+ no_log: yes
+ htpasswd:
+ path: /etc/dovecot/users
+ name: "{{ item.key }}"
+ password: "{{ item.value }}"
+ crypt_scheme: sha512_crypt
+ state: "{{ 'absent' if not item.value or item.value.strip() == '' else 'present' }}"