new tool: Visansible - Visualization of Ansibel-Facts

Hi,

hope you like it and it is useful:

https://github.com/multigcs/visansible

Thanks for this.

I have a couple of suggestions:

Consider using ‘argparse’ so that the inventory file can be specified as it is hard coded to inventory.cfg at the moment.
https://docs.python.org/3.8/library/argparse.html#module-argparse
would be nice to be able to configure the path to the ‘facts’ dir and also the port that the server listens on.

Consider tracking the line number in inventory_read so if it is unable to parse inventory it is possible to see where the error occurs.

I tried with one of my inventory files and it fails like this

Traceback (most recent call last):
File “visansible.py”, line 1663, in
inventory_read()
File “visansible.py”, line 1604, in inventory_read
value = line.split(“=”)[1].strip()
IndexError: list index out of range

I think maybe the inventory_read method doesn’t handle the [group_name:children] or [group_name:vars] syntax that ansible inventory allows.

Jon

Just to say that the issue I had turned out to be because the parsing doesn't handle the possibility that an inventory group may contain the name of one or more groups.

Simple fix seems to be to ignore the line in this case and not to support visualisation of groups within groups, for now.