# bug on sudo\_user parametrization ?

**URL:** <https://forum.ansible.com/t/bug-on-sudo-user-parametrization/13645>\
**Category:** Ansible Developer\
**Created:** [October 9, 2013, 3:04pm UTC](https://forum.ansible.com/t/bug-on-sudo-user-parametrization/13645 "2013-10-09T15:04:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jerome\_Wagner](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@Jerome\_Wagner](https://forum.ansible.com/u/Jerome_Wagner)\
**Post date:** [October 9, 2013, 3:04pm UTC](https://forum.ansible.com/t/bug-on-sudo-user-parametrization/13645/1 "2013-10-09T15:04:48Z")

</div>

Hello,

I have a simplified task like so on the current devel branch :

- name: create sites directory  
file: path=/home/{{ item }}/sites state=directory  
sudo: yes  
sudo\_user: “prefix{{ item }}suffix”  
with\_items:
- user1
- user2

I get the error :  
invalid output was: sudo: unknown user: prefixsuffix

so the templating seems to be done, but without the correct value for {{ item }}.

Am I missing something ?

Thank you

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 9, 2013, 3:06pm UTC](https://forum.ansible.com/t/bug-on-sudo-user-parametrization/13645/2 "2013-10-09T15:06:23Z")

</div>

This seems like a question more appropriate for ansible-users, but the basic scenario is that sudo\_user on the task is pretty new and I don’t think we anticipated this being used with with\_items.

Please file a bug and we can look into it.

–Michael

---

<div class="post-metadata">

**Author:** ![Jerome\_Wagner](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@Jerome\_Wagner](https://forum.ansible.com/u/Jerome_Wagner)\
**Post date:** [October 9, 2013, 3:27pm UTC](https://forum.ansible.com/t/bug-on-sudo-user-parametrization/13645/3 "2013-10-09T15:27:56Z")

</div>

ticket created on  
[https://github.com/ansible/ansible/issues/4411](https://github.com/ansible/ansible/issues/4411)

---

<div class="post-metadata">

**Author:** ![Jerome\_Wagner](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@Jerome\_Wagner](https://forum.ansible.com/u/Jerome_Wagner)\
**Post date:** [October 10, 2013, 9:31am UTC](https://forum.ansible.com/t/bug-on-sudo-user-parametrization/13645/4 "2013-10-10T09:31:09Z")

</div>

For info I added a proposed pr on [https://github.com/ansible/ansible/issues/4411](https://github.com/ansible/ansible/issues/4411)  
I hope I got the sudo\_user flow right.
