I have a group "webservers" where I put all webservers in. As well as a group "mysqlservers" for the database servers respectively.
Now I do also manage some LAMP servers and I want them to be always part of the webservers and mysqlservers group, as well as manage them in a group "lamp"
This is my approach:
--- all: hosts: host1: host2: children: webservers: hosts: web1: web2: web3 children: lamp: mysqlservers: hosts: db1: db2: db3: children: lamp: lamp: hosts: lamp1: lamp2: lamp3: ...
Is that the correct approach? If I followed the ansible docs examples, I would have defined the "lamp" hosts as children of webservers and mysqlservers, but I really want to reduce redundancy. So is it possible to create the group as a child of "all" and just reference it as children of the specified groups without repeating the hosts?