can github.com/ansible/ansible-examples/tree/master/lamp_haproxy be executed simply, using dynamic inventory?

22 views
Skip to first unread message

Gallagher Polyn

unread,
May 27, 2014, 11:12:28 PM5/27/14
to ansible...@googlegroups.com
Hey,

It feels like that all-important beginner's Ansible example 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_<blah-blah> 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

Michael DeHaan

unread,
May 28, 2014, 8:00:03 AM5/28/14
to ansible...@googlegroups.com
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.




--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/0034873d-8304-4cd7-88cb-c1c551c24823%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages