Ansible 2.9 vs 2.10: Delegation in Role Tasks
0 reputation · 17 Nov 2022, 12:46 UTC
Goal
Determine whether the delegate_to setting applied inside a role task behaves the same in Ansible 2.9 and 2.10, and identify any changes that affect variable scoping or execution count.
Constraints
In 2.9, delegate_to works at the task level and does not alter role‑level delegation. Version 2.10 preserves the syntax but introduces a default that treats the entire role as delegated unless overridden. Documentation notes that delegating a role may produce unexpected variable scoping and that run_once can prevent duplicate runs. No migration guide addresses this ambiguity, and minor patch releases after 2.10 may further shift the behavior.
Questions
- Does
delegate_toon a role task default to delegating the entire role in Ansible 2.10? - How does variable scoping change when delegating at the task level between 2.9 and 2.10?
- Is
run_oncerequired to avoid duplicate executions when delegating a role to the same host in 2.10?