# How generate dynamic host file with only IP of concrete vendor (by MAC)

**URL:** <https://forum.ansible.com/t/how-generate-dynamic-host-file-with-only-ip-of-concrete-vendor-by-mac/32731>\
**Category:** Ansible Project\
**Created:** [April 20, 2020, 9:56am UTC](https://forum.ansible.com/t/how-generate-dynamic-host-file-with-only-ip-of-concrete-vendor-by-mac/32731 "2020-04-20T09:56:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michal\_Siman](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@Michal\_Siman](https://forum.ansible.com/u/Michal_Siman)\
**Post date:** [April 20, 2020, 9:56am UTC](https://forum.ansible.com/t/how-generate-dynamic-host-file-with-only-ip-of-concrete-vendor-by-mac/32731/1 "2020-04-20T09:56:07Z")

</div>

Hello to everybody. I would like run ansible playbook on all RPi (raspberry) in our network (at this moment we have around 300 pieces). All RPi have a IP dynamic from DHCP server. My idea is scann complete network found all live IP, get MAC of IP, filter only MAC with RPi vendor and from this IP create a list, dynamic host file. I have ansible on Linux for shure. What you recomend for quick solution? Nmap? Ping by sh from python? I all ready tried some solution but is too slow and non comfortable … maybe somebody solving similar problem in history. Thx

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [April 20, 2020, 11:03am UTC](https://forum.ansible.com/t/how-generate-dynamic-host-file-with-only-ip-of-concrete-vendor-by-mac/32731/2 "2020-04-20T11:03:45Z")

</div>

Take a look at [https://docs.ansible.com/ansible/latest/plugins/inventory/nmap.html](https://docs.ansible.com/ansible/latest/plugins/inventory/nmap.html)

---

<div class="post-metadata">

**Author:** ![David\_Foley](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@David\_Foley](https://forum.ansible.com/u/David_Foley)\
**Post date:** [April 20, 2020, 11:33am UTC](https://forum.ansible.com/t/how-generate-dynamic-host-file-with-only-ip-of-concrete-vendor-by-mac/32731/3 "2020-04-20T11:33:08Z")

</div>

I’m using the following Playbook, which is taken the IP Address Entered from the Jenkins Pipeline:
