DevOps / Ansible Interview questions
Explain the internal working of Ansible's execution model?
Ansible's control node does the heavy lifting of assembling exactly what needs to run, then ships a minimal, self-contained payload to each target rather than relying on anything pre-installed there beyond Python.
For each task, the control node resolves all variables and Jinja2 expressions locally, then packages the relevant module's Python code together with its resolved arguments into a single file, copies that file to a temporary directory on the managed node over the existing SSH connection, and executes it there. The module runs, performs its idempotent check-then-act logic, and prints a JSON result back to the control node over the same channel, which the control node parses to decide whether the task succeeded, failed, or reported a change. The temporary payload is then removed from the managed node, leaving no persistent footprint - this repeats independently for every host (up to the configured fork limit) and every task in the play.
More Related questions...