Ansible Variables Guide¶
Variables help you keep playbooks flexible instead of hardcoding values for every host.
Group Variables¶
Use group variables when the same value applies to many hosts.
Host Variables¶
Use host variables only when one server needs different values.
Practical Advice¶
- Put shared values in group variables first
- Keep host variables small and specific
- Use clear names that match the service or purpose