ansible-role-virt-infra icon indicating copy to clipboard operation
ansible-role-virt-infra copied to clipboard

loading of distro vars overrides host vars

Open csmart opened this issue 3 years ago • 1 comments

Loading distro specific vars, e.g. vars/centos.yml overrides any existing vars that have been set on the command line or as a part of the host inventory. For example, virt_infra_security_driver. Ideally these should only be loaded if a hostvar doesn't exist.

csmart avatar May 17 '21 10:05 csmart

Maybe I should rename the distro defaults with _default in the name and only use it when the user hasn't defined it without _default e.g.

Default in distro:

---
virt_infra_default_security_driver: selinux

User sets inventory:

---
virt_infra_security_driver: none

Code does:

"{{ virt_infra_security_driver |default(virt_infra_default_security_driver) }}"

csmart avatar Sep 12 '21 08:09 csmart