Hi,
Suppose to have a variable (Y) used inside a role (X).
Y is defined inside roles/X/vars/main.yml as “Y: reasonable_default_value”
What about if host (A) must have its Y custom value?
- “Y: a_custom_value” inside host_vars/A doesn’t work (by design or bug?)
This is a working solution (obviously with “Y: a_custom_value” inside vars/A.yml):
playbook
-
hosts: all
vars_files: -
[ “vars/{{ inventory_hostname }}.yml”, “vars/defaults.yml” ]
roles: -
role: X
Are there other better methods?
Thank you!