new tool: Visansible - Visualization of Ansibel-Facts

35 views
Skip to first unread message

Oliver Dippel

unread,
Dec 16, 2019, 11:04:28 PM12/16/19
to Ansible Project
Hi,
hope you like it and it is useful:


network.png


J Hawkesworth

unread,
Dec 30, 2019, 6:03:39 AM12/30/19
to Ansible Project
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.
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 <module>
    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

J Hawkesworth

unread,
Jan 2, 2020, 2:18:07 PM1/2/20
to Ansible Project
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.

Reply all
Reply to author
Forward
0 new messages