# remote\_user temp

**URL:** <https://forum.ansible.com/t/remote-user-temp/16533>\
**Category:** Ansible Project\
**Created:** [October 16, 2014, 4:16pm UTC](https://forum.ansible.com/t/remote-user-temp/16533 "2014-10-16T16:16:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adham\_H](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Adham\_H](https://forum.ansible.com/u/Adham_H)\
**Post date:** [October 16, 2014, 4:16pm UTC](https://forum.ansible.com/t/remote-user-temp/16533/1 "2014-10-16T16:16:32Z")

</div>

Hi

We provision our servers in a cloud provider. The provider injects ssh keys and create a temp user for our initial connection.  
We use that temp user to provision the machine and then the temp user will be disabled.

So the next run for plays will fail because remote\_user does not exist anymore.

Any ideas how we might tackle this in an automated way?

Our goal is every person uses hes username

---

<div class="post-metadata">

**Author:** ![Michael\_Peters](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@Michael\_Peters](https://forum.ansible.com/u/Michael_Peters)\
**Post date:** [October 16, 2014, 7:31pm UTC](https://forum.ansible.com/t/remote-user-temp/16533/2 "2014-10-16T19:31:16Z")

</div>

I have provisioning playbooks (AWS) that create the server. They then  
use add\_host to add it to the inventory.  
When using add\_host you can pass other variables along that act just  
like host\_vars that came from the inventory (AFAIK).  
If you pass the ansible\_ssh\_user you can set the user that ansible  
uses for the remainder of that play to access that  
host.

You can also add the host to any applicable groups. This is where I  
then do my boostrapping of the host and the application of it's  
necessary roles.  
Then when you run another playbook later, the host is now in the  
dynamic inventory and picks up the new real username that works after  
the bootstrapping has been applied.

There's probably other ways to do it, but that's worked pretty well so far.

---

<div class="post-metadata">

**Author:** ![Adham\_H](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Adham\_H](https://forum.ansible.com/u/Adham_H)\
**Post date:** [October 19, 2014, 3:03pm UTC](https://forum.ansible.com/t/remote-user-temp/16533/3 "2014-10-19T15:03:26Z")

</div>

Michel,

Perfect that solved the issue 🙂

Thanks
