Do not use end_play with the conditional when which uses variables
for the condition. The problem is that end_play is executed in a
different scope where the variables are not defined, even when using
set_fact. The fix is to instead use a block and a when.
Do not use
end_play
with the conditionalwhen
which uses variables for the condition. The problem is thatend_play
is executed in a different scope where the variables are not defined, even when usingset_fact
. The fix is to instead use ablock
and awhen
.