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

后端 未结 5 2344
遥遥无期
遥遥无期 2020-12-05 04:47

Is it possible to call a role multiple times in a loop like this:

vars:
  my_array:
    - foo
    - bar
    - baz 
roles:
  - role: foobar
    with_items: my         


        
5条回答
  •  失恋的感觉
    2020-12-05 05:13

    The include_role module is documented here: https://docs.ansible.com/ansible/include_role_module.html

    According to the docs it was introduced in Ansible 2.2 already

提交回复
热议问题