# Template module failing when using su

**URL:** <https://forum.ansible.com/t/template-module-failing-when-using-su/15955>\
**Category:** Ansible Project\
**Created:** [August 15, 2014, 7:21am UTC](https://forum.ansible.com/t/template-module-failing-when-using-su/15955 "2014-08-15T07:21:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Doe1](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@John\_Doe1](https://forum.ansible.com/u/John_Doe1)\
**Post date:** [August 15, 2014, 7:21am UTC](https://forum.ansible.com/t/template-module-failing-when-using-su/15955/1 "2014-08-15T07:21:39Z")

</div>

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](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

`
