One loop over multiple Ansible tasks

后端 未结 3 1518
面向向阳花
面向向阳花 2020-12-29 03:49

I\'ve created an Ansible playbook that creates a cloud instance and then installs some programs on the instance. I want to run this playbook multiple times (without using a

3条回答
  •  盖世英雄少女心
    2020-12-29 03:55

    No that's currently not possible. with_items used to work with the include statement in previous versions of Ansible but was unfortunately dropped.

    Though it will be brought back in Ansible 2.0, see slide 14/15 of What's New in v2 - AnsibleFest London 2015

    enter image description here

    You could try to work with the v2 branch from github, the feature should be available in there.

    What you can do with 1.9.1 is to move your tasks into a role and reference this role multiple times in your playbook.

提交回复
热议问题