Would it make sense to have task results be automatically registered for every task under a pre-defined name? This would eliminate all the “register” lines with ad-hoc names used just for the next task.
Users wishing to persist the results for more than the next task could still use “register” to specify a name. Otherwise the results from the previous task get thrown out on moving on to the next one. That way, all current playbooks would continue to work as expected.
IIRC there has been some discussion on the idea of a default "last
registered" kind of register some (longer) time ago. I believe it was
concluded to not go that way, but I don't remember the details.
I've been thinking of adding `ansible_task_results` as this would be
needed for the 'rescue' side of a block, the proposal we removed was a
$_ similar thing that would give access to the "current tasks's
reigster data". This would be slightly different, but still I prefer
explicit declarations.
I think the implicit register would be a light cognitive load while making things easier and the code cleaner (without any backward compatibility issues maybe?), but I understand the benefits of doing things explicitly and maybe that’s not worth compromising.
Thanks for filling me in on the background context for this. Much appreciated. Btw, v2.0 is looking seriously good