# can github.com/ansible/ansible-examples/tree/master/lamp\_haproxy be executed simply, using dynamic inventory?

**URL:** <https://forum.ansible.com/t/can-github-com-ansible-ansible-examples-tree-master-lamp-haproxy-be-executed-simply-using-dynamic-inventory/15349>\
**Category:** Ansible Project\
**Created:** [May 28, 2014, 3:12am UTC](https://forum.ansible.com/t/can-github-com-ansible-ansible-examples-tree-master-lamp-haproxy-be-executed-simply-using-dynamic-inventory/15349 "2014-05-28T03:12:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gallagher\_Polyn](https://avatars.discourse-cdn.com/v4/letter/g/94ad74/32.png) [@Gallagher\_Polyn](https://forum.ansible.com/u/Gallagher_Polyn)\
**Post date:** [May 28, 2014, 3:12am UTC](https://forum.ansible.com/t/can-github-com-ansible-ansible-examples-tree-master-lamp-haproxy-be-executed-simply-using-dynamic-inventory/15349/1 "2014-05-28T03:12:28Z")

</div>

Hey,

It feels like that all-important beginner’s Ansible example [github.com/ansible/ansible-examples/tree/master/lamp\_haproxy](http://github.com/ansible/ansible-examples/tree/master/lamp_haproxy) can only be used, as written, with static inventory.

For example, I modified the example’s site.yml to use the ec2.py tag\_ option for all named hosts, but the example already chokes on a Jinja template where the following expression is used: {% if (inventory\_hostname in groups[‘webservers’]) or (inventory\_hostname in groups[‘monitoring’]) %}. My suspicion is that this will only be a first conflict that users of dynamic inventory will face when attempting to execute the example.

So, is there some simple modification or approach to executing lamp\_haproxy with dynamic inventory?

Thanks, G

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [May 28, 2014, 12:00pm UTC](https://forum.ansible.com/t/can-github-com-ansible-ansible-examples-tree-master-lamp-haproxy-be-executed-simply-using-dynamic-inventory/15349/2 "2014-05-28T12:00:01Z")

</div>

So this is true, but it’s also ok, since it’s just an example.

If you wanted to use it on a ec2 dynamic inventory, you could just do ec2\_tag\_webservers instead of webservers in both places.
