-
Notifications
You must be signed in to change notification settings - Fork 478
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 details of interactions between notifications and loops #597
base: devel
Are you sure you want to change the base?
Conversation
This clarifies behaviour raised in ansible/ansible#81950 and ansible/ansible#77550 as expected and documented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some initial feedback. Thanks for the contribution!
@lod, are you still interested in proceeding with this PR? |
Co-authored-by: Maxwell G <[email protected]>
@gotmax23 - i committed your suggested edits. Can you take another look and approve the PR if you agree? |
state: restarted | ||
|
||
Note that the handlers are triggered if the task as a whole is changed, for loops that is if any loop item changes. | ||
In the above example both memcached and apache will be restarted if either template file is changed, neither will be restarted if no file changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this behavior is pretty surprising (at least to me, and apparently also to the folks who created the issues in ansible/ansible) I would suggest moving this paragraph before the example, so that you read this before looking at the example. Right now when starting to read this new section, I might just look at the first paragraph and then at the example and then stop, getting the completely wrong impression of what is happening.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I shifted it up and rewrote it slightly.
ansible.builtin.template: | ||
src: "{{ item }}.j2" | ||
dest: /etc/systemd/system/{{ item }}.service | ||
notify: Restart {{ item }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also add a comment inside the example, like this:
notify: Restart {{ item }} | |
# Note: if *any* loop iteration triggers a change, *all* handlers | |
# for this loop are run! | |
notify: Restart {{ item }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Hi @lod We've made some changes to the underlying readthedocs project for this repository. I'm going to close and re-open this issue to kick off a new PR preview build. You might notice there will be two checks for readthedocs. One for The Thank you for your patience and understanding. Also thanks for your contribution to the Ansible documentation. If you have any questions or concerns, please do let us know either here, in the docs channel on Matrix, or in the Ansible forum. Cheers. |
Make the loop trigger even more explicit.
Thanks @felixfontein @samccann and @gotmax23 I incorporated the suggestions and resynced it against the current devel. |
This clarifies behaviour raised in ansible/ansible#81950 and ansible/ansible#77550 as expected and documented.