# Hierarchical lookups.

**URL:** <https://forum.ansible.com/t/hierarchical-lookups/25381>\
**Category:** Ansible Project\
**Created:** [August 31, 2017, 6:44am UTC](https://forum.ansible.com/t/hierarchical-lookups/25381 "2017-08-31T06:44:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Craig\_Dunn](https://avatars.discourse-cdn.com/v4/letter/c/eada6e/32.png) [@Craig\_Dunn](https://forum.ansible.com/u/Craig_Dunn)\
**Post date:** [August 31, 2017, 6:44am UTC](https://forum.ansible.com/t/hierarchical-lookups/25381/1 "2017-08-31T06:44:31Z")

</div>

Hi all

I wanted to reach out here in the hope of getting some feedback / ideas  
from the Ansible community regarding a little side project I've been  
working on lately, an Ansible lookup plugin that can be used to do  
hierarchical data lookups against Jerakia. Jerakia is an open source  
standalone lookup engine that allows top down hierarchical key value  
lookups against a variety of different data sources. This plugins gives  
you the ability to perform key value lookups using the facts from the node  
as a context for traversing a hierarchy. I did a more complete write up on  
this topic here;  
[https://www.craigdunn.org/2017/08/hierarchical-data-lookups-ansible/](https://www.craigdunn.org/2017/08/hierarchical-data-lookups-ansible/)

The lookup plugin I wrote for Ansible (  
[https://github.com/crayfishx/ansible-jerakia](https://github.com/crayfishx/ansible-jerakia)) is pretty new, and I'm also  
fairly novice with both Python and Ansible itself so there may be many  
areas for improvement, and possibly better ways to integrate the two tools  
than a lookup plugin(?)

Feel free to raise issues on the GitHub site(s) and of course,  
contributions are more than welcome 😉

Thanks  
Craig

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [August 31, 2017, 9:51am UTC](https://forum.ansible.com/t/hierarchical-lookups/25381/2 "2017-08-31T09:51:52Z")

</div>

Nice.

A lookup plugin seems to make sense to me.

I suppose another possibility might be keeping your inventory in Jerakia in which case a dynamic inventory script might be another entry point. There is work going on at the moment to make inventory plugins so would be worth asking on the devel google group on ansible-devel channel before developing anything.

Jon
