Document register projections - #3752
Conversation
s-hertel
left a comment
There was a problem hiding this comment.
Looks good to me, just had a couple small suggestions.
|
@pkingstonxyz Hey, CI failures here are unrelated and have been fixed with #3743 and #3757 Could you please rebase your changes against |
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com> Co-authored-by: Patrick Kingston <66141901+pkingstonxyz@users.noreply.github.com>
0ae49e8 to
9e05dd6
Compare
|
Looks like code review suggestions have been addressed, CI is passing, anything else blocking this from being merged? |
- Avoid personal pronouns - Fix voice issues - Clarify example a bit - Add cross references for compatibility
|
Okay I gave it another pass to fix a few straggling grammar issues, my use of personal pronouns, odd passive voice, and added a couple cross references to aid in discoverability. I think it's good to go @nitzmahone @oraNod |
oraNod
left a comment
There was a problem hiding this comment.
A couple of minors but overall LGTM. Thanks @pkingstonxyz
I was thinking about your question:
One candidate for getting its own section is the implicit variable _task for documenting the accessible properties, but I'm unsure where this should be placed (maybe here? docs/docsite/rst/reference_appendices/common_return_values.rst).
I think this could be placed before the note in playbooks_variables.rst here: https://github.com/ansible/ansible-documentation/pull/3752/changes#diff-8edddbcc8bdfa833720c87eadf77339500b78fe9ecf561bd680b20f279aa0395R253
Although I'd say do that as a follow up. This PR looks good to go and we've had a couple of queries about these docs on the forum already. Cheers!
s-hertel
left a comment
There was a problem hiding this comment.
Looks good to me, just had a few small suggestions I missed the first time (sorry).
|
|
||
| .. note:: | ||
|
|
||
| The ``_task`` implicit variable can be used in all conditional keywords, including ``when``, ``until``, ``failed_when``, ``changed_when``, and ``break_when``. |
There was a problem hiding this comment.
Maybe it would be useful to note somewhere that ignore_errors/ignore_unreachable are similar to when, in that the result for the current task/loop item is not available (only previous loop item results).
whitespace nits Co-authored-by: Don Naro <dnaro@redhat.com>
- Add notes to clarify the necessity of default - Make examples cleaner
Add note about defining a variable called _task Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
| command_duration: _task.result.dt | ||
| capitalized_command_output: _task.result.stdout | capitalize |
There was a problem hiding this comment.
shell doesn't include dt in the result, so this example might be clearer if it calculates the duration from available keys
| command_duration: _task.result.dt | |
| capitalized_command_output: _task.result.stdout | capitalize | |
| command_duration: (command_end - command_start).total_seconds() | |
| command_start: _task.result.start | to_datetime(time_format) | |
| command_end: _task.result.end | to_datetime(time_format) | |
| vars: | |
| time_format: '%Y-%m-%d %H:%M:%S.%f' |
This PR documents the new functionality of the
registerkeyword introduced by ansible/ansible#86241. I am confident that this is incomplete and needs adjustments/examples, but these seemed to be the most obvious places thatregisterfunctionality needed updating.I was torn on including a separate page/section by the name of 'register projections' but I opted to instead disperse the various pieces of
registeracross the existing documentation points.One candidate for getting its own section is the implicit variable
_taskfor documenting the accessible properties, but I'm unsure where this should be placed (maybe here? docs/docsite/rst/reference_appendices/common_return_values.rst).Forgot to add it to commit 4dce38a
Co-authored-by: claude code
(Note: I closed that last PR because I was accidentally working from a branch in ansible/ansible-documentation and not in my own fork. lessons learned)