List comprehension like in defaults/main.yml

Hi,

I need to create a list of fqdn according to à list of subdomain and a domain:

app__domain: '{{ ansible_local.core.domain
                      if (ansible_local|d() and ansible_local.core|d() and
                          ansible_local.core.domain|d())
                      else (ansible_domain if ansible_domain else ansible_hostname) }}'

app_subdomains: [ '', 'api' , 'www' ]

app_fqdns: .... ?

app_fqdns must be ['mydomain.com', 'api.mydomain.com', 'www.mydomain.com ]

How could I do this ?

PS: I'm using debops.

Azzz

Hello,

I would do it in a template, but it can be done in a variable as well. An example in a playbook:

`