# simple IP lookup plugin

**URL:** <https://forum.ansible.com/t/simple-ip-lookup-plugin/29715>\
**Category:** Ansible Project\
**Created:** [February 19, 2019, 8:31pm UTC](https://forum.ansible.com/t/simple-ip-lookup-plugin/29715 "2019-02-19T20:31:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Stroder](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@Michael\_Stroder](https://forum.ansible.com/u/Michael_Stroder)\
**Post date:** [February 19, 2019, 8:31pm UTC](https://forum.ansible.com/t/simple-ip-lookup-plugin/29715/1 "2019-02-19T20:31:13Z")

</div>

HI!

Is there a simple example module how to implement an ansible (connection) plugin for looking up an IP address for establishing the SSH connection?

I have a deployment where no DNS entries are present prior to initial host configuration, but I can access another (LDAP) database to query the IP address by inventory\_hostname.

Not sure whether I need a full-blown connection plugin [1] for this.

Ciao, Michael.

[1] [https://docs.ansible.com/ansible/latest/plugins/connection.html](https://docs.ansible.com/ansible/latest/plugins/connection.html)

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [February 19, 2019, 8:56pm UTC](https://forum.ansible.com/t/simple-ip-lookup-plugin/29715/2 "2019-02-19T20:56:15Z")

</div>

It probably easier to create[1] you own inventory plugin[2] so you can populate the ansible\_host with the IP.

[1] [https://docs.ansible.com/ansible/latest/dev\_guide/developing\_inventory.html](https://docs.ansible.com/ansible/latest/dev_guide/developing_inventory.html)  
[2] [https://docs.ansible.com/ansible/latest/plugins/inventory.html](https://docs.ansible.com/ansible/latest/plugins/inventory.html)

---

<div class="post-metadata">

**Author:** ![Michael\_Stroder](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@Michael\_Stroder](https://forum.ansible.com/u/Michael_Stroder)\
**Post date:** [February 21, 2019, 12:13am UTC](https://forum.ansible.com/t/simple-ip-lookup-plugin/29715/3 "2019-02-21T00:13:01Z")

</div>

Yes, you're right. I have this working now after I figured out to set  
'inventory\_plugins' in ansible.cfg and some other details.

Thank you.

Ciao, Michael.
