# remove previously used remote\_user (possibly ControlMaster, ControlPersist problem)

**URL:** <https://forum.ansible.com/t/remove-previously-used-remote-user-possibly-controlmaster-controlpersist-problem/26693>\
**Category:** Ansible Project\
**Created:** [February 8, 2018, 11:35pm UTC](https://forum.ansible.com/t/remove-previously-used-remote-user-possibly-controlmaster-controlpersist-problem/26693 "2018-02-08T23:35:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Davide](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@Davide](https://forum.ansible.com/u/Davide)\
**Post date:** [February 8, 2018, 11:35pm UTC](https://forum.ansible.com/t/remove-previously-used-remote-user-possibly-controlmaster-controlpersist-problem/26693/1 "2018-02-08T23:35:55Z")

</div>

Hi all,

to setup raspberry pis I would like to use the following palybooks (the actual  
yaml is at the end).

1. with remote\_user=defaultuser, become and add newuser
2. with remote\_user=newuser, become and delete defaultuser

If I play this with some docker container as target it works but if the target  
is a raspberry pi 3 (running archlinux or raspbian) I get:

TASK [remove default user] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [192.168.1.129]: FAILED! =\> {“changed”: false, “msg”: “userdel: user defaultuser is currently used by process 615\n”, “name”: “defaultuser”, “rc”: 8}

This seems to happen because when the second playbook runs there is still a  
defaultuser ssh process running from the first playbook.

Looking into it I found out about `-o ControlMaster=auto -o ControlPersist=60s`. And if I `export ANSIBLE_SSH_ARGS='-o ControlMaster=no'`  
before `ansible-playbook` it works also on the raspberry pi.

So my questions are the following.  
Why does this affect the rasperry pi but not some docker containers? With the  
default `ControlPersist=60s` it seems that it should also fail on the docker  
container.

And is it possible to set `ControlMaster=no` for a specific playbook?

Thanks  
Davide

Playbooks:

`

---

<div class="post-metadata">

**Author:** ![Davide](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@Davide](https://forum.ansible.com/u/Davide)\
**Post date:** [February 9, 2018, 11:23pm UTC](https://forum.ansible.com/t/remove-previously-used-remote-user-possibly-controlmaster-controlpersist-problem/26693/2 "2018-02-09T23:23:53Z")

</div>

I found a related post [1](https://groups.google.com/d/msg/ansible-project/woy_asjA5No/c2I86Gq7AwAJ) where it is suggested to just kill all processes  
before deleting the user [2](https://groups.google.com/d/msg/ansible-project/woy_asjA5No/oLxrV6UZCAAJ).
