I can define a variable/list in my main playbook (main.yml) or in my group variables (group_vars/all.yml) but the main.yml variables have precedence over the group variables.
group_vars/all.yml
my_list:
- "item 1"
- "item 2"
main.yml
vars:
my_list:
- "item 3"
- "item 4"
I would like to combine the two but am not sure how to do it. Desired:
my_list: ['item 1', 'item 2', 'item 3', 'item 4']
I have tried adding to the list. For example if main.yml could see group_vars before overwriting (but this example throws an error).
my_list:
- "{{ my_list }}"
- "item 3"
- "item 4"
I am doing this because I am using code from another repository. I don’t want to make changes to their code, but I do want to update (not overwrite) their variable list.