Template module failing when using su

Hello,

I found an error in deploying a file through template module when using su. It stops with error message: “Source /tmp/ansible-tmp-1407982491.27-242988883727372/source not readable.”
When I checked permission on that file I saw that it was 600:

`
-bash-3.2$ ls -lR ansible*
ansible-tmp-1407982491.27-242988883727372:
total 128
-rw-r–r-- 1 johndoe other 61318 Aug 14 09:14 copy
-rw------- 1 johndoe other 220 Aug 14 09:14 source
-bash-3.2$

`

I wonder if anybody have similar problem or maybe you have any ideas what can cause this error?

NB. Just in case: “copy” module works fine; I’ve tried to use Solaris and Linux as managed OS, the result was same.

PS. I’ve sent a bug report, and attached all details about the problem. Here is the link: https://github.com/ansible/ansible/issues/8594

Here is the playbook:

`

  • name: Template fails as su
    hosts: all
    vars:
    user_name: appadm

tasks:

  • name: Create some configuration file
    su: yes
    su_user: “{{ user_name }}”
    template: src=config dest=/tmp/config

`