# how to reference the actual user of a play in a template

**URL:** <https://forum.ansible.com/t/how-to-reference-the-actual-user-of-a-play-in-a-template/12864>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [May 24, 2013, 8:58pm UTC](https://forum.ansible.com/t/how-to-reference-the-actual-user-of-a-play-in-a-template/12864 "2013-05-24T20:58:45Z")\
**Posts on this page:** 5\
**Page:** 1

<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:** [May 24, 2013, 8:58pm UTC](https://forum.ansible.com/t/how-to-reference-the-actual-user-of-a-play-in-a-template/12864/1 "2013-05-24T20:58:45Z")

</div>

Not currently.

I’m open to including “ansible\_ssh\_user” back into the “inject” data for 1.2 though.

Pull requests would be welcome, or you can file a ticket and I’ll get to it.

One line change, I’m pretty sure.

(see the place where we set inject[“vars”] and so on)

---

<div class="post-metadata">

**Author:** ![TextEditor](https://avatars.discourse-cdn.com/v4/letter/t/a88e57/32.png) [@TextEditor](https://forum.ansible.com/u/TextEditor)\
**Post date:** [May 25, 2013, 3:46pm UTC](https://forum.ansible.com/t/how-to-reference-the-actual-user-of-a-play-in-a-template/12864/2 "2013-05-25T15:46:55Z")

</div>

Michael,

I have this problem too, work around it by defining a variable with the username. Would do a fix, but can you give me some more pointers to “where we set inject[“vars”]” is?

---

<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:** [May 26, 2013, 12:37am UTC](https://forum.ansible.com/t/how-to-reference-the-actual-user-of-a-play-in-a-template/12864/3 "2013-05-26T00:37:22Z")

</div>

Yeah, file a ticket I will look into it this week.

---

<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:** [May 26, 2013, 2:29pm UTC](https://forum.ansible.com/t/how-to-reference-the-actual-user-of-a-play-in-a-template/12864/4 "2013-05-26T14:29:25Z")

</div>

Hello,  
I tried to write a patch adding ansible\_ssh\_user. cf pull request [https://github.com/ansible/ansible/pull/3022](https://github.com/ansible/ansible/pull/3022)  
I hope it is ok  
Jerome

---

<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:** [May 26, 2013, 4:36pm UTC](https://forum.ansible.com/t/how-to-reference-the-actual-user-of-a-play-in-a-template/12864/5 "2013-05-26T16:36:01Z")

</div>

This looks good, in queue for testing, thanks!
