Hi,
I’d like to propose a change/feature to vars_files and how it loads the files. Right now when the vars file does not exists an error is risen:
raise AnsibleFileNotFound(“vars file %s was not found” % vars_file_item)
it would be useful if it could skip missing file and proceed without throwing an error. This would help in situation in which the user uses hierarchical and not defined file structure. For example:
vars_files:
- “/etc/ansible/vars/default_site.yml”
- “vars/{{site_name}}.yml”
where site_name is passed as a parameter to ansible_playbook. I know there is include_vars functionality however this is a task so it can’t be used to load certain variables like ansible_user or ansible_password. It also is very verbose which is also not very elegant.
Let me know what is your thought on this.
Best regards,
Wojtek