Vars output differences during ansible run when vars located in /defaults or /vars

Hi,

I’ve fairly new to Ansible and I’ve been trying things out with it.
I’m trying to write a simple playbook. As I’d like to have the ability to [let others] decide what to put in some vars and by following the docs on vars override rules I came up with something like the following:

roles/
php-composer/
defaults/main.xml
tasks/main.xml

Where defaults/main.xml contains:

Just so that we are clear. Are your files really named with a .xml extension? It was it just a typo and you meant .yml?

.yml is the appropriate file extension.

In general it is not straightforward to get var expansion in the name of a task, mainly due to scope. I would however expect defaults and cars to be in the same scope, but without the code in front of me I can’t say. Although in general is recommend staying away from cars in the task names.

Argh! Sorry that was a typo.
They have .yml extension.