Reputation: 121
In ansible I have seen inventory file usage as below:
[somehostlist]
hostname1
hostname2
But is it possible to achieve below:
[hostlist1],[hostlist2]
localhost1
localhost2
[hostlist3],[hostlist4],[hostlist5]
localhost3
Upvotes: 0
Views: 79
Reputation: 44809
This is one way you can achieve it:
[hostlist1]
localhost1
localhost2
[hostlist2:children]
hostlist1
[hostlist3]
localhost3
[hostlist4:children]
hostlist3
[hostlist5:children]
hostlist3
Upvotes: 1