Ansible Directory Structure Explained: Defaults vs Vars (Best Practices & Examples)

Distinguishing between defaults and variables is an important design decision when developing an Ansible role. Defaults serve as your public interface, providing suitable values ​​that users can modify according to their needs. Variables, on the other hand, represent your internal framework, containing constants that must remain constant for the role to function effectively.  Striking the right balance not only makes your role user-friendly, but also ensures that it’s flexible and clearly states what can be customized. A key point is this: use default values ​​for values ​​that users can change, and reserve variables for the role’s internal needs.

Continue reading “Ansible Directory Structure Explained: Defaults vs Vars (Best Practices & Examples)”