Walk through what happens when you run `ansible-playbook site.yml`.
IntermediateConceptFundamentals and Architecture
Answer
- Ansible loads
ansible.cfg, the inventory, and parses the playbook (variables, imports, roles). - For each play it resolves the host pattern against the inventory and applies
serial/forksbatching. - It gathers facts (unless
gather_facts: false) by running thesetupmodule on each host. - For each task, in order, it builds a module payload, copies it to a temp dir on the target, runs it with the discovered Python, reads the JSON result, and removes the temp files.
- Handlers notified by changed tasks run at the end of the play (or at
meta: flush_handlers). - The
PLAY RECAPsummarises ok/changed/failed/unreachable per host.
More on Fundamentals and Architecture
What is Ansible and what problem does it solve?BeginnerWhat does "agentless" mean in Ansible?BeginnerWhat are the requirements for the control node?BeginnerWhat does a managed node need?BeginnerIs Ansible push-based or pull-based?BeginnerWhat is the difference between `ansible`, `ansible-core` and the `ansible` community package?Intermediate