# Ansible managed host issue

**URL:** <https://forum.ansible.com/t/ansible-managed-host-issue/32664>\
**Category:** Ansible Project\
**Created:** [April 12, 2020, 5:54pm UTC](https://forum.ansible.com/t/ansible-managed-host-issue/32664 "2020-04-12T17:54:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Orkhan\_Mammadov](https://avatars.discourse-cdn.com/v4/letter/o/eada6e/32.png) [@Orkhan\_Mammadov](https://forum.ansible.com/u/Orkhan_Mammadov)\
**Post date:** [April 12, 2020, 5:54pm UTC](https://forum.ansible.com/t/ansible-managed-host-issue/32664/1 "2020-04-12T17:54:54Z")

</div>

Hi guys,

Could you please help me regarding to the following issue?

I have setup a control host and 2 managed host, IP Addresses are static and dns is over /etc/hosts file. SSH Keygen is created and copied to managed hosts and I can ssh to managed host without password.

Ansible installed:

**[ansible@control install]$ ansible --version**  
**ansible 2.9.6**  
**config file = /home/ansible/install/ansible.cfg**  
**configured module search path = [‘/home/ansible/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]**  
**ansible python module location = /home/ansible/.local/lib/python3.6/site-packages/ansible**  
**executable location = /home/ansible/.local/bin/ansible**  
**python version = 3.6.8 (default, Nov 21 2019, 19:31:34) [GCC 8.3.1 20190507 (Red Hat 8.3.1-4)]**

Note: ansible1 and ansible2 are managed hosts.

When I add command - ansible all -m user -a “name=lisa”- it gives the following message:

**ansible2 | FAILED! =\> {**  
**“ansible\_facts”: {**  
**“discovered\_interpreter\_python”: “/usr/bin/python”**  
**},**  
**“changed”: false,**  
**“msg”: “useradd: Permission denied.\nuseradd: cannot lock /etc/passwd; try again later.\n”,**  
**“name”: “lisa”,**  
**“rc”: 1**  
**}**  
**ansible1 | FAILED! =\> {**  
**“ansible\_facts”: {**  
**“discovered\_interpreter\_python”: “/usr/bin/python”**  
**},**  
**“changed”: false,**  
**“msg”: “useradd: Permission denied.\nuseradd: cannot lock /etc/passwd; try again later.\n”,**  
**“name”: “lisa”,**  
**“rc”: 1**

It took me a lot of time to find solution, but could not find anything. Is anyone faced with this error message

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [April 12, 2020, 6:12pm UTC](https://forum.ansible.com/t/ansible-managed-host-issue/32664/2 "2020-04-12T18:12:01Z")

</div>

> Hi guys,
> 
> Could you please help me regarding to the following issue?
> 
> I have setup a control host and 2 managed host, IP Addresses are static and dns is over /etc/hosts file. SSH Keygen is  
> created and copied to managed hosts and I can ssh to managed host without password.

You need to be superuser (root) on the managed hosts to create new users.

Add -b (--become) and if applicable -K (--ask-become-pass) to your command line.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![Orkhan\_Mammadov](https://avatars.discourse-cdn.com/v4/letter/o/eada6e/32.png) [@Orkhan\_Mammadov](https://forum.ansible.com/u/Orkhan_Mammadov)\
**Post date:** [April 12, 2020, 6:42pm UTC](https://forum.ansible.com/t/ansible-managed-host-issue/32664/3 "2020-04-12T18:42:52Z")

</div>

It worked, gr8 thanks. I am new in ansible and learning with Sanders’s RHCE video course.
