Ansible tips
set_statsmust havedataset_stats: data: failure_reason: "Duplicate."-
Cannot loop on a
block -
debugcannot show up in a play, but only intasks -
set_statsvariables cannot be used within same playbook, but only in other playbooks -
set_stats/set_factcannot partially change a dictionary, the correct way is to use “combine” filter -
unless in a role,
include/importcannot be insidetasks, but only outside -
importis static,includeis dynamic -
varsin a task is NOT recognizable in the where clause, butloop_controlvar is.
varsin a task is recognizable in theloopclause - variable scope (e.g.
set_fact) covers all the descendant and ancestor playbooks included.
Therefore vars in descendant/ancestor playbooks are alwasy overwritten by parent/offspringset_factdue to precedence.