Skip to content

Conversation

@malikdotexe
Copy link
Contributor

SUMMARY
Improve the Ansible error handling documentation by clarifying failed_when conditions and fixing minor syntax errors.

ISSUE TYPE

  • Docs Pull Request

COMPONENT NAME
playbook_guide/playbooks_error_handling.rst

ANSIBLE VERSION
N/A

ADDITIONAL INFORMATION
This PR makes three key improvements to the error handling documentation:

  1. Enhanced failed_when explanation: Added a practical example showing how to use the or operator in failed_when conditions, making it clearer that users can trigger failure when ANY condition is met (not just all conditions).

  2. Template syntax fix: Corrected malformed Jinja2 braces by removing extra space in {{ log_path }}{{ log_file }}.

These changes improve readability and correctness of the documentation without changing any functionality.

- Add clarifying example for 'or' operator in failed_when conditions
- Fix template syntax: remove extra space in Jinja2 braces

Signed-off-by: Piyush Malik <[email protected]>
@ansible-documentation-bot ansible-documentation-bot bot added the new_contributor This PR is the first contribution by a new community member. label Nov 15, 2025
@ansible-documentation-bot
Copy link
Contributor

Thanks for your Ansible docs contribution! We talk about Ansible documentation on Matrix at #docs:ansible.im if you ever want to join us and chat about the docs! We meet on Matrix every Tuesday. See the Ansible calendar for meeting details. We welcome additions to our weekly agenda items too. You can add the dawgs-meeting tag to a forum topic to bring it up at the next meeting.

@malikdotexe
Copy link
Contributor Author

Thanks for the review! I’ve applied your suggested change. Let me know if anything else is needed.

@gotmax23 gotmax23 requested a review from a team December 3, 2025 17:27
Copy link
Contributor

@oraNod oraNod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @malikdotexe

@oraNod oraNod added backport-2.18 Automatically create a backport for the stable-2.18 branch backport-2.19 Automatically create a backport for the stable-2.19 branch backport-2.20 Automatically create a backport for the stable-2.20 branch labels Dec 3, 2025
@oraNod oraNod requested a review from felixfontein December 3, 2025 19:28
@oraNod oraNod merged commit 7cefbd2 into ansible:devel Dec 3, 2025
12 checks passed
@patchback
Copy link

patchback bot commented Dec 3, 2025

Backport to stable-2.18: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 7cefbd2 on top of patchback/backports/stable-2.18/7cefbd2a0c80ae0d5b3e7fee2d114ed43f9c05b0/pr-3249

Backporting merged PR #3249 into devel

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible/ansible-documentation.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-2.18/7cefbd2a0c80ae0d5b3e7fee2d114ed43f9c05b0/pr-3249 upstream/stable-2.18
  4. Now, cherry-pick PR Improve failed_when documentation and fix minor errors #3249 contents into that branch:
    $ git cherry-pick -x 7cefbd2a0c80ae0d5b3e7fee2d114ed43f9c05b0
    If it'll yell at you with something like fatal: Commit 7cefbd2a0c80ae0d5b3e7fee2d114ed43f9c05b0 is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x 7cefbd2a0c80ae0d5b3e7fee2d114ed43f9c05b0
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR Improve failed_when documentation and fix minor errors #3249 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-2.18/7cefbd2a0c80ae0d5b3e7fee2d114ed43f9c05b0/pr-3249
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@patchback
Copy link

patchback bot commented Dec 3, 2025

Backport to stable-2.19: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-2.19/7cefbd2a0c80ae0d5b3e7fee2d114ed43f9c05b0/pr-3249

Backported as #3332

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Dec 3, 2025
* Improve failed_when documentation and fix minor errors

- Add clarifying example for 'or' operator in failed_when conditions
- Fix template syntax: remove extra space in Jinja2 braces

Signed-off-by: Piyush Malik <[email protected]>

* Update docs/docsite/rst/playbook_guide/playbooks_error_handling.rst

Co-authored-by: Felix Fontein <[email protected]>

---------

Signed-off-by: Piyush Malik <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 7cefbd2)
@patchback
Copy link

patchback bot commented Dec 3, 2025

Backport to stable-2.20: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-2.20/7cefbd2a0c80ae0d5b3e7fee2d114ed43f9c05b0/pr-3249

Backported as #3333

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Dec 3, 2025
* Improve failed_when documentation and fix minor errors

- Add clarifying example for 'or' operator in failed_when conditions
- Fix template syntax: remove extra space in Jinja2 braces

Signed-off-by: Piyush Malik <[email protected]>

* Update docs/docsite/rst/playbook_guide/playbooks_error_handling.rst

Co-authored-by: Felix Fontein <[email protected]>

---------

Signed-off-by: Piyush Malik <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 7cefbd2)
oraNod pushed a commit that referenced this pull request Dec 3, 2025
* Improve failed_when documentation and fix minor errors

- Add clarifying example for 'or' operator in failed_when conditions
- Fix template syntax: remove extra space in Jinja2 braces



* Update docs/docsite/rst/playbook_guide/playbooks_error_handling.rst



---------



(cherry picked from commit 7cefbd2)

Signed-off-by: Piyush Malik <[email protected]>
Co-authored-by: Piyush Malik <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
oraNod pushed a commit that referenced this pull request Dec 3, 2025
* Improve failed_when documentation and fix minor errors

- Add clarifying example for 'or' operator in failed_when conditions
- Fix template syntax: remove extra space in Jinja2 braces



* Update docs/docsite/rst/playbook_guide/playbooks_error_handling.rst



---------



(cherry picked from commit 7cefbd2)

Signed-off-by: Piyush Malik <[email protected]>
Co-authored-by: Piyush Malik <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-2.18 Automatically create a backport for the stable-2.18 branch backport-2.19 Automatically create a backport for the stable-2.19 branch backport-2.20 Automatically create a backport for the stable-2.20 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.

3 participants