loop over roles?

Hi

I have a bunch of roles in my playbook:

roles:
  - role_1
  - role_b
  - { role: install_app, install_dir=/opt/foo }
  - { role: install_app, install_dir=/opt/bar }
  - { role: install_app, install_dir=/opt/baz }
  - finalrole

Suppose I have a var that contains

apps:
  foo
  bar
  baz

Would it be possible to loop over these in the roles section?

Thanks

Dick

Hi, not it’s not possible.

Same question on github - https://github.com/ansible/ansible/issues/12623