How do I apply an Ansible with_items loop to the included tasks?

后端 未结 2 1777
独厮守ぢ
独厮守ぢ 2021-01-11 16:56

The documentation for import_tasks mentions

Any loops, conditionals and most other keywords will be applied to the included tasks, not to this statem

2条回答
  •  [愿得一人]
    2021-01-11 17:33

    It is not possible. include/import statements operate with task files as a whole.

    So with loops you'll have:

    Task 1 with Item 1
    Task 2 with Item 1
    Task 3 with Item 1
    Task 1 with Item 2
    Task 2 with Item 2
    Task 3 with Item 2
    Task 1 with Item 3
    Task 2 with Item 3
    Task 3 with Item 3
    

提交回复
热议问题