-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Clarifies how Ansible processes multiple failed_when
conditions
#55941
Conversation
It is not immediately obvious that multiple `failed_when` conditions are joined with `AND`. I assumed they would be joined with `OR`. (Since that would be more useful.) Also, there are multiple third party pages online incorrectly stating that it uses `OR`. ([example](https://groups.google.com/d/msg/ansible-project/cIaQTmY3ZLE/c5w8rlmdHWIJ)). So it's worth clarifying. +label: docsite_pr
failed_when
conditions
Thanks again to @mlda065 for suggesting (and starting) this improvement! |
Yeah sorry about messing up that other PR. I deleted and recreated my fork for some other PR, but forgot that it would break this one. So now I'm not sure how to add more to this PR. For the multiline example, how about this?
|
@mlda065 ah, thanks for chiming in - okay if i merge this PR and let you add your multi-line example in a separate PR? |
Yes, go ahead and merge. I'll add that other example after the merge. |
…sible#55941) Docs: Clarify that multiple failed_when conditions join with AND not OR to counter third-party pages online incorrectly stating that it uses `OR`. ([example](https://groups.google.com/d/msg/ansible-project/cIaQTmY3ZLE/c5w8rlmdHWIJ)). (cherry picked from commit 5439eb8)
* Update windows_setup.rst (#55535): Wrong protocol and port in command. (cherry picked from commit 6ea3eca) * Clarify the two targets of vault encryption, with notes about advantages and drawbacks of each Co-Authored-By: tacatac <taca@kadisius.eu> (cherry picked from commit 79198ca) * Improve consistency of loop documentation (#55674) (cherry picked from commit a5cb47d) * Add Microsoft Document URL for WinRM Memory Hotfix (#55680) Co-Authored-By: hiyokotaisa <thel.vadam2485@gmail.com> (cherry picked from commit 7b86208) * Clarify the documentation for `async` and `poll`; describe the behavior when `poll` = 0 and when it does not. Co-Authored-By: tacatac <taca@kadisius.eu> (cherry picked from commit dbc64ae) * Add security group info and example to AWS guide (#55783): expand documentation on how to use lookup plugin aws_service_ip_ranges with ec2_group module (cherry picked from commit bb5059f) * correct description of modules vs plugins (#55784) (cherry picked from commit 9d5b5d7) * Fix var naming (#55795): Make vars match tasks in Google Compute guide. (cherry picked from commit 943f733) * Clarifies how Ansible processes multiple `failed_when` conditions (#55941): multiple failed_when conditions join with AND not OR to counter third-party pages online incorrectly stating that it uses `OR`. ([example](https://groups.google.com/d/msg/ansible-project/cIaQTmY3ZLE/c5w8rlmdHWIJ)). (cherry picked from commit 5439eb8) * Docs: edits & expands module_utils & search path info in dev guide (#55931) (cherry picked from commit 8542459) * Add faq note about ssh ServerAliveInterval (#55568) (cherry picked from commit 76dba7a) * docsite: correct path, list requirements for testing module docs, etc. (#52008) * dev_guide: correct path, list requirements, etc.; module HTML docs are in '_build/html/module' subdir (cherry picked from commit b14f477) * Developer documentation update involving module invocation (#55747) * Update docs for the 2.7 change to AnsiballZ which invokes modules with one less Python interpreter * Add a section on how module results are returned and on trust between modules, action plugins, and the executor. * Update docs/docsite/rst/dev_guide/developing_program_flow_modules.rst Co-Authored-By: abadger <a.badger@gmail.com> (cherry picked from commit edafa71) * add doc example of multiline failed_when with OR (#56007) * add variety to multiple OR failed_when doc example (cherry picked from commit 7d5ada7) * Note that by default the regex test is identical to match, but can do much more (#50205) * Note that the regex test behaves like 'match', with default settings (cherry picked from commit 86e98c5) * more info on how vaults work (#56183) also add warning about what it covers. (cherry picked from commit 8ff27c4) * Fix var naming in GCE guide (cherry picked from commit dae5564) * dev_guide: Various small updates (#53273) * Document the clarifications that I usually remark when doing reviews * Update docs/docsite/rst/dev_guide/developing_modules_documenting.rst Co-Authored-By: dagwieers <dag@wieers.com> (cherry picked from commit eac7f1f) * Lack of "--update" flag in older Ubuntu distros (#56283): when installing on older Ubuntu distributions be aware of the lack of ``-u`` or ``--update`` flag. (cherry picked from commit dd0b0ae) * should have gone into 52373 (#56306) (cherry picked from commit 3c8d8b1)
SUMMARY
Supersedes #55870. The original branch/fork for that PR disappeared.
Clarifies that lists of conditions for
failed_when
are connected with an implicitAND
operator. Adds an example of a task with multiplefailed_when
conditions connected by an explicitOR
operator.ISSUE TYPE
COMPONENT NAME
docs.ansible.com