Cod_enthu
Cod_enthu

Reputation: 121

Is there a way to have multiple tags mentioned for one server in Ansible inventory file

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

Answers (1)

Zeitounator
Zeitounator

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

Related Questions