-
Notifications
You must be signed in to change notification settings - Fork 83
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
postfix_sender_canonical_maps.db not updated #111
Comments
Do you have an idea why? |
nope. I did not resolve this, I run manually |
Are you able to run the playbook with the -vv verbosity level and inform if ansible reports a change on the |
Sorry for the delay. I made some changes in my config to rewrite every sender: admin_mail: "[email protected]"
postfix_sender_canonical_maps:
- sender: "/.+/"
rewrite: "{{ admin_mail }}"
postfix_sender_canonical_maps_database_type: "regexp" So, I ran twice:
TASK [oefenweb.postfix : configure sender canonical maps] *********************
task path: /home/user/Dev/gitlab.com/ansible/.roles_requirements/oefenweb.postfix/tasks/main.yml:127
Friday 17 September 2021 09:48:33 +0200 (0:00:00.029) 0:01:55.283 ******
ok: [edsdev] => (item={'sender': '/.+/', 'rewrite': '[email protected]'}) => {"ansible_loop_var": "item", "backup": "", "changed": false, "item": {"rewrite": "[email protected]", "sender": "/.+/"}, "msg": ""}
TASK [oefenweb.postfix : configure sender canonical maps] *********************
task path: /home/user/Dev/gitlab.com/ansible/.roles_requirements/oefenweb.postfix/tasks/main.yml:127
Friday 17 September 2021 09:52:54 +0200 (0:00:00.026) 0:01:52.695 ******
changed: [edsdev] => (item={'sender': '/.+/', 'rewrite': '[email protected]'}) => {"ansible_loop_var": "item", "backup": "", "changed": true, "item": {"rewrite": "[email protected]", "sender": "/.+/"}, "msg": "line replaced"}
NOTIFIED HANDLER oefenweb.postfix : postmap sender_canonical_maps for edsdev |
I'm still having a problem with this happening for the sasl_password file not being handled when there it a change. I will take a look at it and see if I can create a fix. In my case, what happened was the playbook errored after the sasl_password file was created so the handler was never reached. I'm not entirely sure that the postmap commands should occur in a handler because a change is never raised in the edge case where the playbook has an error after the role, the error is fixed and the playbook is run again. |
Did you take a look @ljurgs? In most cases handlers are called when there're errors, right? |
As far as I know, handlers do not get raised if an error causes the playbook execution to abort. |
From the latest Ansible docs:
Maybe it can be mentioned the use of |
If run the playbook with this:
and then run it again with a change in
postfix_sender_canonical_maps
:the
postmap
command is not launch again and and/etc/postfix/postfix_sender_canonical_maps.db
not updated with new or modified entries.In Postfix logs we can also see
The text was updated successfully, but these errors were encountered: