Hi
I have a few use cases where I define a list in group_vars/all.yml,
for instance a list of users:
users:
- allen
- bob
- chris
- dick
So this list applies to all hosts in my case.
But for a specific host, I want to add one entry to the list.
The only way I can get that to work is by copying the list in
host_vars/somehost/main.yml and just manually add it:
users:
- allen
- bob
- chris
- dick
- extrauser
Obviously this is not ideal as any changes made to the first var will
have to be manually carried over to the specific instances.
Is there some way to append items to list vars (or subtract, for that matter)?
I was hoping to be able to use something like:
users: "{{ users }} + ['extrauser']"
But that gives me "recursive loop detected in template string".
Any other/clean ways to solve this?
Thanks!!