I have an inventory file
[hosttype1]
Server
Server2
[hosttype2]
server3
server4
I am trying to read this as a whole into ansible. The file is used in the normal way to define hosts and types for code deploy, but I need to also read the full content for adding into a config file.
the inventory file differs for different environments being deployed, so there is no fixed location for it.
Is it possible to read the file and create a variable that I can then loop over and use the hosttype and a comparitor?