I am using templates and with_items to loop over a directory of templates. 
When I do just one item, in my list it works. With 2 lines it fails:

Works:
  - name: replace variables in templates
    template: src={{item}}.j2 dest={{ mule }}/{{item}}
    with_items:
#      trp-adapter.xml
      trp.properties
ok: [root-build] => (item=trp.properties) => {"changed": false, etc.

Works:
  - name: replace variables in templates
    template: src={{item}}.j2 dest={{ mule }}/{{item}}
    with_items:
      trp-adapter.xml
#      trp.properties
ok: [root-build] => (item=trp-adapter.xml) => {"changed": false, etc.

Fails:
  - name: replace variables in templates
    template: src={{item}}.j2 dest={{ mule }}/{{item}}
    with_items:
      trp-adapter.xml
      trp.properties
fatal: [root-build] => input file not found at 
/home/ansible/svn/playbooks/rolebased/roles/esb/templates/trp-adapter.xml 
or /home/ansible/svn/playbooks/rolebased/trp-adapter.xml

Ansible is not looking for the .j2 file in the third example:
$ ls /home/ansible/svn/playbooks/rolebased/roles/esb/templates
trp-adapter.xml.j2

Bug? Can I do this a better way?

-- 
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 [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to