# Loading complex types from lookup plugins

**URL:** <https://forum.ansible.com/t/loading-complex-types-from-lookup-plugins/14448>\
**Category:** Ansible Project\
**Created:** [January 29, 2014, 1:16am UTC](https://forum.ansible.com/t/loading-complex-types-from-lookup-plugins/14448 "2014-01-29T01:16:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Porter](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@Michael\_Porter](https://forum.ansible.com/u/Michael_Porter)\
**Post date:** [January 29, 2014, 1:16am UTC](https://forum.ansible.com/t/loading-complex-types-from-lookup-plugins/14448/1 "2014-01-29T01:16:43Z")

</div>

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:
