Skip to content
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

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from

Conversation

lod
Copy link

@lod lod commented Oct 12, 2023

This clarifies behaviour raised in ansible/ansible#81950 and ansible/ansible#77550 as expected and documented.

This clarifies behaviour raised in ansible/ansible#81950 and ansible/ansible#77550 as expected and documented.
@github-actions github-actions bot added the needs_triage Needs a first human triage before being processed. label Oct 12, 2023
@gotmax23 gotmax23 added the new_contributor This PR is the first contribution by a new community member. label Oct 13, 2023
Copy link
Collaborator

@gotmax23 gotmax23 left a 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!

@gotmax23 gotmax23 added backport-2.15 Automatically create a backport for the stable-2.15 branch backport-2.14 Automatically create a backport for the stable-2.14 branch backport-2.16 Automatically create a backport for the stable-2.16 branch labels Oct 13, 2023
@gotmax23 gotmax23 added the needs_info requesting more detail from OP label Nov 24, 2023
@gotmax23
Copy link
Collaborator

@lod, are you still interested in proceeding with this PR?

@samccann samccann removed needs_info requesting more detail from OP needs_triage Needs a first human triage before being processed. labels Jan 18, 2024
@samccann
Copy link
Contributor

@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.
Copy link
Collaborator

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.

ansible.builtin.template:
src: "{{ item }}.j2"
dest: /etc/systemd/system/{{ item }}.service
notify: Restart {{ item }}
Copy link
Collaborator

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:

Suggested change
notify: Restart {{ item }}
# Note: if *any* loop iteration triggers a change, *all* handlers
# for this loop are run!
notify: Restart {{ item }}

@oraNod
Copy link
Contributor

oraNod commented Sep 12, 2024

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 docs/readthedocs.org:stage-ansible-core and another for docs/readthedocs.org:ansible-core.

The stage-ansible-core check is for the old project and will result in a 404. Please ignore that and use the ansible-core check only.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-2.14 Automatically create a backport for the stable-2.14 branch backport-2.15 Automatically create a backport for the stable-2.15 branch backport-2.16 Automatically create a backport for the stable-2.16 branch new_contributor This PR is the first contribution by a new community member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants