How do a flaten a list mixed with nested dict in ansible playbook?

HOW TO -️ October 18, 2021

I have a variable named packages as showed below, it is not a plain list, I have some nested dict in it like browsers.

ERROR Rendering Code Block

I'd like to use instructions like below

ERROR Rendering Code Block

to install all the pacakges defined in the variable, but I do not know what filter I should use the convert the variable to plain list, I need the items in the nested dictionary.

any help will be appreciated.


Please provide an example var definition that is valid yaml. Your current example cannot be parsed so no one can understand the exact data structure you want to use. Note that the problem also exists for your example task (but it is a little easier to guess).