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

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ff055ee2-393d-4818-bbe6-3558e49c990d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to