elway: add register: to capture step output into playbook vars
#4
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to elway's tier 1 + tier 2 idempotency. Would pair well with
when:andchanged_when:.Semantics
register: <var_name>captures the step's exit code + stdout + stderr into the playbook vars namespace under that name.{{ var.stdout }},{{ var.stderr }},{{ var.rc }},{{ var.state }}.when:/shell:/ etc. via the regular templating.Implementation impact
_stream_processcurrently streams output directly and doesn't capture. Would need to tee: stream to terminal AND buffer for registered variables.substitute()needs to resolve dotted attribute access ({{ var.field }}) in addition to simple{{ var }}.LOE
~60-100 LOC. Blocked on no external dep; just a tee + a nested-attribute templater.
Why file separately
Same reason as #3 (handlers): valuable but not urgent. Tier 1+2 covers the common case, and you can always register by tee-ing to a file on the remote and
cating it in a later step'swhen:.