Inventory

21 views
Skip to first unread message

Vino B

unread,
Mar 20, 2018, 3:14:52 PM3/20/18
to Ansible Project
Hi All,

Can someone provide me an example on how to accomplish the below task,

I have 10 task, I need to execute 5 task on all the host which are under the group test in the inventory file and task 6-8 on first 2 servers only and the task 9-10 to the last server only.


Host file
[test]
Server1
Server2
Server3

From,
Vino.B

Brian Coca

unread,
Mar 20, 2018, 3:37:00 PM3/20/18
to Ansible Project
- hosts: test
tasks:
- task1
- task2
- task3
- task4
- task5

- hosts: test[0], test[1]
tasks:
- task6
- task7
- task8

- hosts: test[-1]
tasks:
- task9
- task10

--
----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages