Replies: 2 comments 3 replies
-
You don't need to register target vars to make them available across tasks, this is done automatically. See 2695910 for more details. I'm not sure what will happen if you (re)set the empty var this way, as I have never checked this scenario, but it looks like you won't even reach this point as you set the leaders conditionaly. Probably dropping Generally speaking, the idea of disallowing setting empty register variables may break some use cases completely unrelated to yours, as I think people may need to set variables to empty values for whatever reason. If we really want to address the dynamic target issue, the change likely should be in the |
Beta Was this translation helpful? Give feedback.
-
Same result
This won't have the desired effect because the map that is passed to What do you think about adding a new |
Beta Was this translation helpful? Give feedback.
-
Hi!
I'm having a few issues while trying to run this playbook:
The playbook performs a
check-recovery
task on each host to discover the leader. Then, in the next task, some queries are executed on the leader host.pghost3
) is the leader, and as a result, the res.Vars variable has a value ofmap[leader:pghost3]
. If you change the order in default targets, the last assigned value in theres.Vars
map will be[leader:]
and spot will error out on the last task:res.Vars
should be limited to one task, but when usingregister
, this variable is used to set targets in another task. Is this correct?Beta Was this translation helpful? Give feedback.
All reactions