How do you override a variable for one host only?
BeginnerConceptVariables, Facts and Precedence
Answer
Put it in host_vars/<hostname>.yml (or inline in the inventory). Host variables beat group variables of any group, so this is the clean per-host exception.
# inventory/host_vars/web3.yml
nginx_worker_processes: 8
For a one-off run, pass -e with --limit web3. Keep exceptions rare, because every host-specific override makes the fleet harder to reason about.
More on Variables, Facts and Precedence
Where can you define variables in Ansible?BeginnerHow do you reference a variable, and when must you quote it?BeginnerGive a summary of variable precedence.IntermediateWhat are the lowest and highest precedence sources, and why does that matter?IntermediateWhat is the difference between a role's `defaults/` and `vars/`?IntermediateWhat are facts and how are they gathered?Beginner