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

feature request: support network ansible_facts data structure

Open r1k0 opened this issue 4 years ago • 0 comments

Hello,

Thanks for the project it works well.

I was hoping to share the need for an enhancement, I would like to run:

$ ansible -m setup --tree out/ linux
$ ansible -m ios_facts --tree out/ ios
$ ansible -m nxos_facts --tree out/ nxos
$ ansible-cmdb out/ > overview.html

where linux/ios/nxos/etc.. are inventory groups of said platforms.

clearly the facts data structure between setup and network is different but not that much, i.e.: setup -> ansible_hostname network (ios_facts/nxos_facts/etc..) -> ansible_net_hostname (i think network modules inherits from 'connection: network')

So, my request is less specific to a platform but more about a way to feed ansible_facts network data structure and have ansible-cmdb.py do the job the same way it does now.

In the end, my overview.html page would have a mix of different devices/platforms (ios_facts/nxos_facts/bigip_facts or any _facts module), each displaying its specific data structure (when it's a network device, display columns from the network device template, when it's a linux, keep things as they are) ). Could work with a lame check such as: if ansible_net_hostname exists, then use the network template (which has less columns - a default ansible_net_hostname and maybe some comon top level like ansible_net_interfaces) (I assume ansible_hostname and ansible_net_hostname can never co exist - makes sense but i dont know for sure).

Let me know your thoughts on this enhancement. It feels like a minor change but specific enough that it's not obvious to me yet where to make the change. Also you might have suggestions ;)

Thanks for your time and keep up the good work

r1k0 avatar May 11 '20 11:05 r1k0