# lining up users when bootstrapping a system

**URL:** <https://forum.ansible.com/t/lining-up-users-when-bootstrapping-a-system/19750>\
**Category:** Ansible Project\
**Created:** [November 12, 2015, 5:54pm UTC](https://forum.ansible.com/t/lining-up-users-when-bootstrapping-a-system/19750 "2015-11-12T17:54:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg\_Swift](https://avatars.discourse-cdn.com/v4/letter/g/34f0e0/32.png) [@Greg\_Swift](https://forum.ansible.com/u/Greg_Swift)\
**Post date:** [November 12, 2015, 5:54pm UTC](https://forum.ansible.com/t/lining-up-users-when-bootstrapping-a-system/19750/1 "2015-11-12T17:54:48Z")

</div>

I’ve been bashing at this since yesterday and have read around a lot and tried lots of things. I figured it was time to try the list.

Basically I’m trying to create a playbook that will be used when bootstrapping a fresh host. The root user is needed for the initial bootstrap. After the on target steps, several other systems have to have an action run on them authorizing the bootstrapped host, one of which is puppet. Here is are some examples of what I tried.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [November 13, 2015, 7:06am UTC](https://forum.ansible.com/t/lining-up-users-when-bootstrapping-a-system/19750/2 "2015-11-13T07:06:28Z")

</div>

try:

- hosts: boxens  
&nbsp;&nbsp;remote\_user: root  
&nbsp;&nbsp;tasks:  
&nbsp;&nbsp;&nbsp;&nbsp;- yum: name={{ item }} state=present  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with\_items: packages  
&nbsp;&nbsp;&nbsp;&nbsp;- command: "puppet agent --noop --server={{ puppetmaster }}"  
&nbsp;&nbsp;&nbsp;&nbsp;- command: "puppet cert sign {{ ansible\_fqdn }}"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delegate\_to: "{{ puppetmaster }}"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;remote\_user: "{{lookup('env','USER')}}"

or just set your own user name directly.

---

<div class="post-metadata">

**Author:** ![Greg\_Swift](https://avatars.discourse-cdn.com/v4/letter/g/34f0e0/32.png) [@Greg\_Swift](https://forum.ansible.com/u/Greg_Swift)\
**Post date:** [November 17, 2015, 4:35am UTC](https://forum.ansible.com/t/lining-up-users-when-bootstrapping-a-system/19750/3 "2015-11-17T04:35:46Z")

</div>

problem with setting user directly is when the playbook is shared. Doing an env lookup has a problem in that local\_user != remote\_user.

-greg
