Parameterised task vars - default values

Hi,

Is it possible to assign default values to parameters passed to tasks with having to assign them at playbook level or other lower precedence levels?

e.g. for:

group_vars/all is great for defaults.

Though perhaps I am not fully understanding the question.

The situation is that I have multiple customers who have their own inventory files, currently seperated out by name. e.g.:

/etc/ansible/jimsbolts/test-hosts
/etc/ansible/bobssprockets/live-hosts

These clients share general playbooks (e.g. an apache one, a postgresql one). It’d be really useful if instead of setting defaults at the group vars level, and so have to maintain defaults across all customers, defaults were available at task level to allow setting common values that can be overridden by assignment at the time of task call or left out to get the default.

Matt

One suggestion -- You could make groups for your individual customers
and keep them in the same directory, and then use the multiple
inventory file support by just doing "-i directory/" to target all of
them or "-i directory/acme.yml" to target acme.

I've seen that done this way quite frequently.

The customers also have sub groups (dev,test,live) with separate playbooks for each (as recommended in the documentation). Having them all in the same place with multiple groups will get messy and confusing and increases the risk of mistakes. Having low priority assignments at the task level seemed to be an elegant solution.