-
Notifications
You must be signed in to change notification settings - Fork 616
porting guide 2.19: async_status started/finished #2576
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
base: devel
Are you sure you want to change the base?
Conversation
@@ -688,7 +688,16 @@ No notable changes | |||
Modules | |||
======= | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 > 0
oris truthy
, should be used instead.
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 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 <[email protected]>
Fixes #2575