mirror of
https://github.com/roles-ansible/ansible_role_rspamd.git
synced 2024-08-16 17:09:51 +02:00
make this role idempotent with lots of magic
This commit is contained in:
parent
c4848bcaa3
commit
5920e18555
3 changed files with 19 additions and 12 deletions
|
@ -1,5 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: Einstellung des Worker controllers
|
- name: rspamd password generation
|
||||||
|
block:
|
||||||
|
- name: configure rspamd password
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: templates/worker-controller.inc.j2
|
src: templates/worker-controller.inc.j2
|
||||||
|
@ -8,6 +10,10 @@
|
||||||
owner: "{{ rspamd__default_owner }}"
|
owner: "{{ rspamd__default_owner }}"
|
||||||
group: "{{ rspamd__default_group }}"
|
group: "{{ rspamd__default_group }}"
|
||||||
notify: systemctl restart rspamd
|
notify: systemctl restart rspamd
|
||||||
|
rescue:
|
||||||
|
- name: you have to install passlib
|
||||||
|
fail:
|
||||||
|
msg: 'I caught an error. Maybe you have to install passlib via pip3'
|
||||||
|
|
||||||
- name: Einstellung des logging
|
- name: Einstellung des logging
|
||||||
become: true
|
become: true
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
password = "{{ _rspamd__admin_password }}"
|
password = "{{ rspamd__admin_password_with_salt }}"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
# versionscheck
|
# versionscheck
|
||||||
playbook_version_number: 6 # should be a integer
|
playbook_version_number: 7 # should be a integer
|
||||||
playbook_version_path: 'do1jlr.rspamd.version'
|
playbook_version_path: 'do1jlr.rspamd.version'
|
||||||
|
|
||||||
_rspamd__admin_password: "{{ rspamd__admin_password | password_hash('bcrypt') }}"
|
# https://github.com/ansible/ansible/issues/36129
|
||||||
|
rspamd__admin_password_with_salt: "{{ rspamd__admin_password | password_hash('bcrypt', ('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' | shuffle(seed=inventory_hostname) | join)[:21] + ('Oeu' | shuffle(seed=inventory_hostname) | join)[1], rounds=9) }}"
|
||||||
|
|
Loading…
Reference in a new issue