How to view all modules in use by a given node
Given a node name (and environment) with root access to either the puppet masters or puppet db, what's a good way to pull down all modules/classes in use by a given node, recursively?
Let's say foo.bar is assigned to module baz. Ideally, we'd print out module baz, then check all includes and inherits statements and recursively print all other modules. If it matters, we're simply using 10_nodes.pp as our node classifier.
I swear I've done this before through PuppetDB but cannot remember how to pull this off. Any suggestions would be appreciated. I'd rather not have to rely on a git checkout of our configs and then parse through that if it can be avoided. I was hoping for something built-in. Thanks!