Hi


Please help me to add new column in my desktop file 
/root/ansible-cmdb/src/ansiblecmdb/data/tpl/csv_03042020_test01.tpl.


*Current tpl code =*

{"title": "Disk avail", "id": "disk_avail", "visible": True, "field": 
lambda h: host['ansible_facts'].get('ansible_mounts', {})},


*Current Output*

[root@client01 ~]#
"Hostname","IP","OS","Arch","Total Mem","Total Swap","CPUs","Virt","Disk 
avail"
"client01","192.168.0.107","CentOS 
7.7","x86_64/x86_64","0g","1g","1","virtualbox/guest","[{u'block_used': 
34799, u'uuid': u'd0342420-fb92-4314-843e-e80e826c1c2d', u'size_total': 
1063256064, u'block_total': 259584, u'inode_available': 523962, 
u'block_available': 224785, u'size_available': 920719360, u'fstype': 
u'xfs', u'inode_total': 524288, u'mount': u'/boot', u'device': 
u'/dev/sda1', u'inode_used': 326, u'block_size': 4096, u'options': 
u'rw,seclabel,relatime,attr2,inode64,noquota'}, {u'block_used': 321789, 
u'uuid': u'52e1cfde-3352-4832-a685-ee4b29050a9b', u'size_total': 
8575254528, u'block_total': 2093568, u'inode_available': 4165331, 
u'block_available': 1771779, u'size_available': 7257206784, u'fstype': 
u'xfs', u'inode_total': 4192256, u'mount': u'/', u'device': 
u'/dev/mapper/centos_ansiblemaster-root', u'inode_used': 26925, 
u'block_size': 4096, u'options': 
u'rw,seclabel,relatime,attr2,inode64,noquota'}]"




I would i like to add *mount,fstype,device* in my tpl file,please suggest 
how can i add only those columns in the tpl.


"ansible_mounts": [
{
"block_available": 224785,
"block_size": 4096,
"block_total": 259584,
"block_used": 34799,
"device": "/dev/sda1",
"fstype": "xfs",
"inode_available": 523962,
"inode_total": 524288,
"inode_used": 326,
"mount": "/boot",
"options": "rw,seclabel,relatime,attr2,inode64,noquota",
"size_available": 920719360,
"size_total": 1063256064,
"uuid": "d0342420-fb92-4314-843e-e80e826c1c2d"
},

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/167503f9-7b1a-4b40-a319-bb66ab7b1f55%40googlegroups.com.

Reply via email to