# Dynamic inventory inside a playbook example

**URL:** <https://forum.ansible.com/t/dynamic-inventory-inside-a-playbook-example/17631>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [February 26, 2015, 10:18pm UTC](https://forum.ansible.com/t/dynamic-inventory-inside-a-playbook-example/17631 "2015-02-26T22:18:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Mehrotra](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@Rahul\_Mehrotra](https://forum.ansible.com/u/Rahul_Mehrotra)\
**Post date:** [February 26, 2015, 10:18pm UTC](https://forum.ansible.com/t/dynamic-inventory-inside-a-playbook-example/17631/1 "2015-02-26T22:18:28Z")

</div>

Hi,  
I am currently working on using dynamic inventory for configuring ec2 instances on AWS environment. I would appreciate if someone can give an example of how ec2.py can be used inside a playbook to provide dynamic inventory information to other plays in the same playbook or to other playbooks using the include statement.

Thank you
