Adding a custom column
keith6014 opened this issue · 1 comments
keith6014 commented
I have a command to check if a machine has a particular license. The output is True/False.
The command is
./prdlic getlicense
Is there a way to get all the facts (ansible -m setup --tree out/ ), get license status of host, and place it in a column for a report?
arturmartins commented
Hi @keith6014:
That's a 2 steps process:
- First, you need to create a custom ansible fact (/etc/ansible/facts.d/YOUR_SCRIPT.fact)
https://medium.com/opsops/custom-facts-for-ansible-ade5f78d6d94 - which output needs to be valid json - Lastly, use ansible-cmdb
--custom-cols
option to add your column: https://github.com/fboender/ansible-cmdb/blob/master/example/cust_cols.conf