Hello,
I want Ansible to examine the vars folder, and even if it’s empty or doesn’t contain a default.yml file, I don’t want it to fail. I’ve tried the following code, but it doesn’t seem to be working. Do you have any ideas on what I might be doing wrong?
Thank you. I haven’t tried it, but it doesn’t seem to be the most elegant solution. Normally, the task shouldn’t even run if it doesn’t find a file. That’s why I would have preferred using ‘when’ in this case.
Thank you. Then I think it would be easier to include a ‘default.yml’ as a fallback in the ‘vars’ folder, even if it’s empty, and do this for each role.