Include multiple tasks from different roles

18 views
Skip to first unread message

Sunny Bhatheja

unread,
Sep 13, 2016, 1:00:46 PM9/13/16
to Ansible Project
I want to include multiple tasks from different roles in a specific order. As of now my playbook looks like 

---
- name: test play
  hosts
: all

  tasks
:
   
- include: ../roles/common/tasks/{{ item }}
      with_items
:
       
- main.yml
       
- a.yml
       
- b.yml
   
- include: ../roles/role1/tasks/stop.yaml
    - include: ../roles/common/tasks/{{ item }}
      with_items
:
       
- c.yml
       
- d.yml
       
- e.yml
   
- include: ../roles/role1/tasks/start.yaml


So is it a correct way to approach such kind of requirement OR there is cleaner way to achieve this? 

- Sunny B
Reply all
Reply to author
Forward
0 new messages