I'm trying to have a template uploaded only if the template exists
*locally*. My use case is having a bunch of items with common parts
configured on the same role. Something like
- template: src=nginx/{{ item }}.j2 dest={{ nginx_sites_dir }}/{{
item }}
with_items: apps
when: file_exists|nginx/{{ item }}.j2
- template: src=uwsgi/{{ item }}.j2 dest={{ uwsgi_dir }}/{{ item }}
with_items: apps
when: file_exists|uwsgi/{{ item }}.j2
So for every 'app' it would configure Nginx only if a template exists on
'templates/nginx/' for this specific app, and likewise for uwsgi.
Is there some conditional that could be used here? I could probably live
with 'ignore_errors: yes' but this could mask other unintended problems.
--
Jordi Funollet Pujol
http://www.linkedin.com/in/jordifunollet