Loading complex types from lookup plugins

I’ve been crafting a lookup plugin recently to fetch information from Hiera, as we’re heavily a Puppet shop but are investigating Ansible for managing small one-off systems that would be too complicated to manage with Puppet. To do so, I got a pull request merged in the Hiera project that allows the ‘hiera’ client to optionally return data in JSON, which I then parse and return from a lookup plugin.

In order to keep from hardcoding Hiera lookups in templates and such, I load them (and clean up the names) in a variables file like: