Append to variables instead of overriding them

Hello.

Is it possible to append variable to another one in vars files?

I have a use case for this: I want to create a large list of packages to install on a Debian system. I have global packages (e.g, tmux), that I want to be available everywhere, group specific variables, defined in group_vars, and host specific variables, that are defined in host_vars. Is it possible to somehow concatenate those variables to feed resulting list to the apt module?

Hello Andrei,

Hello Benjamin,

well the problem is if I want to combine multiple lists, I’ll have to define 3 different variables for group_vars/all, group_vars/group, and host_vars/host. I guess, it’s inescapable.