Split inventory in multiple .yml files?

Hi,

is it possible to split inventory in multiple files…

eg.
I have 3 projects on one virtual machine1, so I created group machine which consists of 3 subelements (projects), ProjectA, ProjectB and ProjectC

[Machine1]
ProjectA ansible_ssh_host=machine1_fqdn
ProjectB ansible_ssh_host=machine1_fqdn
ProjectC ansible_ssh_host=machine1_fqdn

So when I want to run some playbook I choose some (or all) of this projects.

But, my question is, is it possible to split ProjectA inventory file in multiple inventory files…
Somehow include in it every *.yml file in some specific folder…

eg.
ProjectA inventory consists of every *.yml file in ProjectA folder
So my hosts_vars would be:

ProjectA - file

ProjectA - folder

ProjectB - file

ProjectB - folder

ProjectC - file

ProjectC - folder

Thanks a lot!

yes

have a look at this article: http://allandenot.com/devops/2015/01/16/ansible-with-multiple-inventory-files.html

we are using it this way.
`

├── inventory │ ├── group_vars │ │ ├── all │ │ │ ├── vars.yml │ │ │ └── vault.yml │ └── host_vars │ ├──host1 │ │ │ ├── vars.yml │ │ │ └── vault.yml

192.168.20.10
`

Thank you Denis…that is what I needed

Dana petak, 3. ožujka 2017. u 16:54:06 UTC+1, korisnik Dennis Klein napisao je: