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:
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.