Open Anasme opened 5 years ago
Hi Anasme!
I'm not sure, but it looks like you're specifying a path to a directory for the -i
param, instead of pointing it to the hosts
file. If you point -i
to the hosts
file as shown in your directory listing, it will automatically pick up the group_vars
and host_vars
dirs in that same dir.
Can you try something like?:
ansible-cmdb -i /etc/ansible/inventories/prod/hosts out/ > overview.html
If that still gives errors, let me know, and I can look into it.
Confirmed that this is a bug in ansible-cmdb.
For now I've "fixed" this by skipping directories in host_vars
. Not really a fix, but I'm reworking the parsing of host/group vars and don't want to invest time in properly parsing the myriad of exceptions and hidden features in Ansible inventories in the old code.
For now I've "fixed" this by skipping directories in
host_vars
. Not really a fix, but I'm reworking the parsing of host/group vars and don't want to invest time in properly parsing the myriad of exceptions and hidden features in Ansible inventories in the old code.
Hey ! Thank for your reply. Nice to hear you are reworking this part :), I will wait for it, I'm on another project atm. I stay tunned !
hey @fboender , how are you? what's new on the redesign of your ansible-cmdb?
Hello,
I'm trying ansible-cmdb and it seem very nice, thank you. Unfortunately I encounter an error when reading my inventory:
my inventories tree look like this (exemple of course): in host_vars I have some server with 2 subfolders like ./server/vars ./server/vault
. ├── group_vars │ ├── all │ │ └── 000_cross_env_vars -> ../../../000_cross_env_vars │ ├── prod_censored_ab │ │ ├── dns.yml │ │ └── censored.yml │ ├── prod_censored_am_expert │ │ ├── parameters.yml │ │ └── censored.yml │ ├── prod_censored_am_pro │ │ ├── dns.yml │ │ ├── document.yml │ │ ├── nginx_vhosts.yml │ │ ├── parameters.yml │ │ └── censored.yml │ ├── prod_censored_xyxyx │ │ └── document.yml │ ├── prod_censored_xyxyxy │ │ └── censored.yml │ ├── prod_censored_xyxy │ │ └── censored.yml │ ├── prod_censored_xyx │ │ ├── document.yml │ │ └── censored.yml │ ├── prod_censored_yy │ │ ├── document.yml │ │ └── censored.yml │ ├── prod_censored_x │ │ └── censored.yml │ ├── prod_censored_xy │ │ ├── dns.yml │ │ └── censored.yml │ ├── prod_soft_gitlab │ │ └── dns.yml │ └── prod_soft_vc │ ├── dns.yml │ └── nginx.yml ├── hosts └── host_vars ├── server1 │ ├── vars │ └── vault ├── server2 │ ├── censored.yml │ └── vault ├── server3 │ ├── dns.yml │ ├── document.yml │ ├── nginx.yml │ ├── censored.yml │ └── vault ├── server4 │ ├── vars │ └── vault ├── server5 │ ├── vars │ └── vault ├── server6 │ ├── vars │ └── vault ├── server7 │ ├── vars │ └── vault ├── server8 │ ├── vars │ └── vault
I want to create a cmdb with your tools to retrieve the basic information that you propose, add all the variables by groups/hosts and some additional facts that I could automate (apache version, tomcat etc.)
Thank a lot for your future help