# Run ansible as 2 totally speerate users on the same "master" server

**URL:** <https://forum.ansible.com/t/run-ansible-as-2-totally-speerate-users-on-the-same-master-server/31025>\
**Category:** Ansible Project\
**Created:** [August 12, 2019, 8:42pm UTC](https://forum.ansible.com/t/run-ansible-as-2-totally-speerate-users-on-the-same-master-server/31025 "2019-08-12T20:42:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steven\_Mething](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@Steven\_Mething](https://forum.ansible.com/u/Steven_Mething)\
**Post date:** [August 12, 2019, 8:42pm UTC](https://forum.ansible.com/t/run-ansible-as-2-totally-speerate-users-on-the-same-master-server/31025/1 "2019-08-12T20:42:01Z")

</div>

Hi,

I am a newbie trying to migrate from salt to ansible. I am trying to learn how to manage/use ansible but struggling. Salt has a “seperation model” I like and understand but ansible I cant figure out, I guess I am contaminated with the “salt way” and cant fathom ansible yet.

Anyway, I have a user configured in ansible as “svc1” this user runs all the production playbooks etc and is configured in /etc/ansible/\* as the user to run under as per normal.

I would like to run ansible to build servers as a separate user, “svc2” with separate ssh keys and playbooks etc to prevent me “damaging” 1 or more production servers by mistake as I know so little.

So,

a) I have a second user “svc2”.  
b) A /home/svc2/ansible\_hosts setup that only has the specific build target FQDN in it but when I run an ansible command its looking for /home/svc1/ansible\_hosts

I need a method on how to work safely.

The only way I can see is to bypass the default config in /etc/ansible/\* and specify where ansible\_hosts is on the command line? and run as svc2 and not svc1 by default, can this be done? if so how can I do this? or otherwise how can I guarantee complete isolation from production?

regards

Steven

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [August 12, 2019, 9:32pm UTC](https://forum.ansible.com/t/run-ansible-as-2-totally-speerate-users-on-the-same-master-server/31025/2 "2019-08-12T21:32:37Z")

</div>

Create a directory and in that directory create a ansible.cfg, when you run Ansible command cd to this directory first and you have a self contained Ansible configuration that you also can have in a source control management tool like Git.

---

<div class="post-metadata">

**Author:** ![Steven\_Mething](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@Steven\_Mething](https://forum.ansible.com/u/Steven_Mething)\
**Post date:** [August 12, 2019, 11:20pm UTC](https://forum.ansible.com/t/run-ansible-as-2-totally-speerate-users-on-the-same-master-server/31025/3 "2019-08-12T23:20:49Z")

</div>

Looks good, brilliant, thanks!
