porting guide 2.19: async_status started/finished#2576
porting guide 2.19: async_status started/finished#2576samccann merged 2 commits intoansible:develfrom
Conversation
| ======= | ||
|
|
||
| No notable changes | ||
| * With the changes to the templating system it is no longer possible to use ``async_status`` module's ``started`` and ``finished`` integer properties as values in conditionals as booleans are required. It is recommended to use ``started`` and ``finished`` test plugins instead, for example: |
There was a problem hiding this comment.
Shouldn't this be in the "Playbooks > Broken conditionals" section? As that is not a module level change.
There was a problem hiding this comment.
My reasoning behind placing this under Modules was that the general information about "broken conditionals" is already covered in the section you mentioned and this particular entry is about async_status module return values being used (now) incorrectly in the module's examples.
Though I am fine moving it into the "Broken conditionals" section.
There was a problem hiding this comment.
The recommendation to use the started and finished test plugins is specific to the async_status return data, so I think it's better here rather than cluttering the generic section with module specific solutions.
The generic issue of implicit boolean conversion is already covered in the first example in the Broken conditionals section, and applies to async_status too.
Example - implicit boolean conversion
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This expression relies on an implicit truthy evaluation of
inventory_hostname.
An explicit predicate with a boolean result, such as| length > 0oris truthy, should be used instead.
There was a problem hiding this comment.
thanks for the explanation, makes sense then
|
I noticed there are a couple out of date examples in docs/docsite/rst/playbook_guide/playbooks_async.rst too. Other than that, looks good to me. Could be fixed in another PR though. |
Co-authored-by: Don Naro <dnaro@redhat.com>
Backport to stable-2.19: 💚 backport PR created✅ Backport PR branch: Backported as #2596 🤖 @patchback |
* porting guide 2.19: async_status started/finished * Update docs/docsite/rst/porting_guides/porting_guide_core_2.19.rst Co-authored-by: Don Naro <dnaro@redhat.com> --------- Co-authored-by: Don Naro <dnaro@redhat.com> (cherry picked from commit a3adac4)
* porting guide 2.19: async_status started/finished * Update docs/docsite/rst/porting_guides/porting_guide_core_2.19.rst --------- (cherry picked from commit a3adac4) Co-authored-by: Martin Krizek <martin.krizek@gmail.com> Co-authored-by: Don Naro <dnaro@redhat.com>
Fixes #2575