ansible-cmdb icon indicating copy to clipboard operation
ansible-cmdb copied to clipboard

Display _only_ custom columns

Open Ondjultomte opened this issue 6 years ago • 1 comments

Is there a way to view only custom coloumns. exclude alla standard coloumns can be used but it would be nice to have ir -Cx to only have the custom ones in the output.

Ondjultomte avatar Sep 10 '19 12:09 Ondjultomte

That's not possible (yet). For now you'll have to specify the custom columns in the --columns parameter. You could use a little wrapper script to automatically fetch the columns from the custom column definition file:

#!/bin/sh

CUST_COLS="$(grep '"id":' cust_cols.conf | cut -d":" -f2 | sed 's/.*"\(.*\)".*/\1/' | tr '\n' ',')"
ansible-cmdb --cust-cols ./cust-cols.conf --columns $CUST_COLS --out/

I'll see about implementing a special switch for this in the future, but it's going to be low priority for now I'm afraid.

fboender avatar Sep 05 '21 07:09 fboender