ansible-cmdb
ansible-cmdb copied to clipboard
for windows servers some columns are blank
Hi,
This tool is amazing. I got some windows servers in my ansible inventory. When I check the html report the follwing columns are in black:
Disk Usage PhysDisk size
Also the Virt column show me this:
?/?
There is a way to fix it.
Thanks in advance
Federico
Hi Federico!
I'm not sure if ansible collects the required facts for those columns on windows. I currently don't have access to any Windows hosts with Ansible. Can you send me an example output of the facts for windows (out/some.windows.host) at [email protected] so I can have a look at whether it has the necessary information?
thansks for your replly I just sent you an email
Hi Ferry,
Please let me know if you have an update on thins. I got a playbook example that extracts some data.
Thanks in advance
Federico
Maybe use https://docs.ansible.com/ansible/latest/modules/win_disk_facts_module.html for show disk info?
Hi, I have almost exclusive windows environment and also would like to have filled all columns in output. I created small powershell script which is readable by ansible
it is visible in this snippet:
"ansible_disk_info": { "Capacity": "50.00", "DeviceID": "C:", "DriveType": 3, "FreeSpaceGB": "30.35", "VolumeName": ""},
I attached whole generated file from windows machine
is it possible to add support for win machines into cmdb?
Thanks & Best Regards Peter
Hi systemfifteen,
The windows-host.json.txt doesn't look like valid JSON. A few values are not quoted. For example
"ansible_domain": domain.com,
If you can manage to fix those problems, I believe you should be able to use these files with ansible-cmdb fairly straight forward. Normally you'd run ansible -m setup --tree out/ all and you'd get a directory of files that look almost the same as your windows-host.json.txt. So if you just manage to get those files in similar directory, where each file is named like the host it belongs too, it should work. Sometime like:
out/
win01.mydomain.com
Where win01.mydomain.com has the contents of the windows-host.json.txt file. If you then run ansible-cmdb like this:
ansible-cmdb -i hosts out/ > overview.html
It should work. You may not have all the facts, but you can tweak your input script, the colums or a complete template to customize your output.
Hi,
sorry, those unquoted values was my effort for anonymization of file :-)
in fact I was able to create html (or any other) report from that file. My only problem is that, for linux machines I can see disk usage with no problem, but for windows servers it is not showing anything.
Through collection I used "-a fact_path='C:\ansible_facts'" with that one line powershell so it produced earlier mentioned snippet along with all other gathered data. it only seems that ansible-cmdb can't interpret said snippet as it does not know how.
so resolution to window machines is simulating ansible disk output similar to linux machines
anyway thanks for reply 👍 I have hint how to proceed Best Regards Peter
ran into the same thing today, but i don't fully understand. @systemfifteen could you post here if you manage to get the disk sizes? I remember from long ago one could include facter... no idea if that is still possible.