ansible-inventory-grapher icon indicating copy to clipboard operation
ansible-inventory-grapher copied to clipboard

Pure graphviz template

Open MTN-RowinAndruscavage opened this issue 8 years ago • 4 comments

So I was playing around with the OCD layout trying to get all the vars left-justified, and graphviz's html subset just wasn't fully honoring the align="left" declarations anywhere, so I ended up stripping all of the html out. This gets everything lined up nicely, but the tradeoff is that we lose the fine font control. :/

This should probably just be a separate template, but I thought since it was so much simpler, it might serve as a better default template to use as a starting point for people making custom templates. I cleaned up the html default template a bit and added it to the README as an example for an "advanced" custom template. Could just as easily reverse that if you'd like to stick with the current html default template, though... let me know!

MTN-RowinAndruscavage avatar Jun 29 '16 01:06 MTN-RowinAndruscavage

I'm not sure on this one yet - might be good to regenerate the example pics for the various attribute examples (this would be good for #20 either way) and perhaps the new template for comparison's sake. Use the -q option if you want to keep the images smaller for compactness.

If you're ok with generating the pictures, that's good, otherwise I'll find some time to do it at some point.

Example inventory for the pictures is just https://github.com/willthames/ansible-ec2-example

willthames avatar Jun 29 '16 01:06 willthames

Yeah, let's focus on #20 first, that one is intended to be less controversial :D
Updated the example image for that PR.

MTN-RowinAndruscavage avatar Jun 29 '16 13:06 MTN-RowinAndruscavage

I think on balance I'd just prefer ease of choice of templates - perhaps provide a mechanism of switching between different provided templates. I'd like to preserve the existing template as default for now because it's what people expect, but it's definitely handy to see a simpler version.

willthames avatar Jul 01 '16 06:07 willthames

Yeah, if you'd like, let me go ahead and flip this around so it just leaves the default html template, and I'll just add the simple one to the README.md as an example. Otherwise, just feel free to close this PR... it's not going to stop me from tracking master :-D . Just wanted to share how to get the var names left-justified rather than open an issue to whine about what's apparently a bug in the graphviz html align="left" layout engine.

It /would/ be nice to ship a directory with a collection of nice templates to choose from, but maybe as a separate repo, since those things can get kinda crazy. I could see people wanting to add javascript and mouseovers to highlight groups of hosts, or tie into monitoring systems, or do graphml exports for viewing with yEd, or stuff like that.

MTN-RowinAndruscavage avatar Jul 01 '16 07:07 MTN-RowinAndruscavage