Hey Michael,
Thanks for your reply.
I know you said not to use ${var} and $var style. However I'm confused. I try to always use {{ }}, but sometimes it won't work.
For example, when I perform "with_items".
I also noticed that you're planning to deprecate "with_items" from includes. Why is that such a bad thing?
I find it really useful.
Here is a scenario where it's useful for me:
I have a role called "nginx/site". This role simply controls the state of an nginx site.
Now, I have another role that is called "nginx/sites", this role does the same, however it accepts lists of dictionaries regarding each site.
Inside this role, I perform:
- include: ../../site/tasks/main.yml nginx_site={{ item }}
with_items: $nginx_sites
Is that such a bad thing?
I was thinking about the whole thing... I was fighting with this nginx/sites and php5-fpm/pools roles for sometime.
Maybe the right why to go here would be to develop a "module" for a single site and a module for a single php/pool.
And then the role would use those modules. It looks cleaner for me. Would it be a better way to approach it?
Another thing I've noticed in regards of defaults... When I define a list in defaults/main.yml, it won't be parsed inside a "with_items" call.
When I move this var to the main playbook var decleration, it works. Is that on purpose?
Thanks a lot,
and sorry if I ask too many questions :) It's just I'm really passionate about Ansible and would like to know a lot about it :)