Ansible: How to iterate over a role with an array?

Now supported as of Ansible 2.3.0:

- name: myrole
  with_items:
    - "aone"
    - "atwo"
  include_role:
    name: myrole
  vars:
    thing: "{{ item }}"

Leave a Comment