Interview Prep/Ansible/Vault, Performance and Execution Behaviour

With `strategy: free`, a task that reads `hostvars['db01'].db_ready` fails on some runs

AdvancedTroubleshootingVault, Performance and Execution Behaviour
Answer

Likely causes → free lets each host run ahead on its own, so a web host can reach its task before db01 has set db_ready. With the default linear strategy, every host finishes task N before any host starts task N+1.

Fix → Split the work into separate plays (database first, then web), or keep the play linear. Use free only for plays whose hosts do not depend on each other.

Prevent → Treat cross-host dependencies (hostvars, delegate_to another inventory host, run_once results) as a sign that free is not appropriate.

All Ansible questions Roadmap: Ansible

More on Vault, Performance and Execution Behaviour