# Beginner, can't complete this step

**URL:** <https://forum.ansible.com/t/beginner-cant-complete-this-step/29438>\
**Category:** Ansible Project\
**Created:** [January 14, 2019, 10:44pm UTC](https://forum.ansible.com/t/beginner-cant-complete-this-step/29438 "2019-01-14T22:44:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mboncalo](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@mboncalo](https://forum.ansible.com/u/mboncalo)\
**Post date:** [January 14, 2019, 10:44pm UTC](https://forum.ansible.com/t/beginner-cant-complete-this-step/29438/1 "2019-01-14T22:44:24Z")

</div>

Hi  
Sorry , this must be to easy for you but I can't figure it out. I was  
following some ansible video tutorials and I can't go further because  
of some errors

ansible all -m user -a name=linda  
ansible3 | FAILED! =\> {  
&nbsp;&nbsp;&nbsp;&nbsp;"changed": false,  
&nbsp;&nbsp;&nbsp;&nbsp;"msg": "useradd: Permission denied.\nuseradd: cannot lock  
/etc/passwd; try again later.\n",  
&nbsp;&nbsp;&nbsp;&nbsp;"name": "linda",  
&nbsp;&nbsp;&nbsp;&nbsp;"rc": 1  
}  
ansible4 | FAILED! =\> {  
&nbsp;&nbsp;&nbsp;&nbsp;"changed": false,  
&nbsp;&nbsp;&nbsp;&nbsp;"msg": "useradd: Permission denied.\nuseradd: cannot lock  
/etc/passwd; try again later.\n",  
&nbsp;&nbsp;&nbsp;&nbsp;"name": "linda",  
&nbsp;&nbsp;&nbsp;&nbsp;"rc": 1  
}  
ansible2 | FAILED! =\> {  
&nbsp;&nbsp;&nbsp;&nbsp;"changed": false,  
&nbsp;&nbsp;&nbsp;&nbsp;"cmd": "/sbin/useradd -m linda",  
&nbsp;&nbsp;&nbsp;&nbsp;"msg": "[Errno 13] Permission denied",  
&nbsp;&nbsp;&nbsp;&nbsp;"rc": 13  
}  
ansible1 | FAILED! =\> {  
&nbsp;&nbsp;&nbsp;&nbsp;"changed": false,  
&nbsp;&nbsp;&nbsp;&nbsp;"cmd": "/sbin/useradd -m linda",  
&nbsp;&nbsp;&nbsp;&nbsp;"msg": "[Errno 13] Permission denied",  
&nbsp;&nbsp;&nbsp;&nbsp;"rc": 13

I'm trying to add an user on 4 machines.  
-created project directory  
-created ansible.cfg file with this content:  
[defaults]  
remote\_user = ansible  
host\_key\_checking = false  
inventory = inventory

[priviledge\_escalation]  
become = True  
become\_method = sudo  
become\_user = root  
become\_ask\_pass = False  
-created inventory file:  
[all]  
ansible1  
ansible2  
ansible3  
ansible4

-user ansible was created on all machines and has sudo access  
-ssh-copy-id was used for all machines  
-all machines are in /etc hosts with the name from inventory file

> From what I see, ansible is trying to add the user without becoming root

Adding user or becoming root works without any issue

Thank you,  
Mihai.

---

<div class="post-metadata">

**Author:** ![cassell](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@cassell](https://forum.ansible.com/u/cassell)\
**Post date:** [January 14, 2019, 10:50pm UTC](https://forum.ansible.com/t/beginner-cant-complete-this-step/29438/2 "2019-01-14T22:50:54Z")

</div>

> Hi  
> Sorry , this must be to easy for you but I can't figure it out. I was  
> following some ansible video tutorials and I can't go further because  
> of some errors
> 
> ansible all -m user -a name=linda  
> ansible3 | FAILED! =\> {  
> &nbsp;&nbsp;&nbsp;&nbsp;"changed": false,  
> &nbsp;&nbsp;&nbsp;&nbsp;"msg": "useradd: Permission denied.\nuseradd: cannot lock  
> /etc/passwd; try again later.\n",  
> &nbsp;&nbsp;&nbsp;&nbsp;"name": "linda",  
> &nbsp;&nbsp;&nbsp;&nbsp;"rc": 1  
> }  
> ansible4 | FAILED! =\> {  
> &nbsp;&nbsp;&nbsp;&nbsp;"changed": false,  
> &nbsp;&nbsp;&nbsp;&nbsp;"msg": "useradd: Permission denied.\nuseradd: cannot lock  
> /etc/passwd; try again later.\n",  
> &nbsp;&nbsp;&nbsp;&nbsp;"name": "linda",  
> &nbsp;&nbsp;&nbsp;&nbsp;"rc": 1  
> }  
> ansible2 | FAILED! =\> {  
> &nbsp;&nbsp;&nbsp;&nbsp;"changed": false,  
> &nbsp;&nbsp;&nbsp;&nbsp;"cmd": "/sbin/useradd -m linda",  
> &nbsp;&nbsp;&nbsp;&nbsp;"msg": "[Errno 13] Permission denied",  
> &nbsp;&nbsp;&nbsp;&nbsp;"rc": 13  
> }  
> ansible1 | FAILED! =\> {  
> &nbsp;&nbsp;&nbsp;&nbsp;"changed": false,  
> &nbsp;&nbsp;&nbsp;&nbsp;"cmd": "/sbin/useradd -m linda",  
> &nbsp;&nbsp;&nbsp;&nbsp;"msg": "[Errno 13] Permission denied",  
> &nbsp;&nbsp;&nbsp;&nbsp;"rc": 13
> 
> I'm trying to add an user on 4 machines.  
> -created project directory  
> -created ansible.cfg file with this content:  
> [defaults]  
> remote\_user = ansible  
> host\_key\_checking = false  
> inventory = inventory
> 
> [priviledge\_escalation]

Try priviledge\_escalation -\> privilege\_escalation

V/r,  
James Cassell

---

<div class="post-metadata">

**Author:** ![mboncalo](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@mboncalo](https://forum.ansible.com/u/mboncalo)\
**Post date:** [January 14, 2019, 10:54pm UTC](https://forum.ansible.com/t/beginner-cant-complete-this-step/29438/3 "2019-01-14T22:54:12Z")

</div>

Work like a charm! Thank you!

---

<div class="post-metadata">

**Author:** ![Will\_Brown](https://avatars.discourse-cdn.com/v4/letter/w/a9adbd/32.png) [@Will\_Brown](https://forum.ansible.com/u/Will_Brown)\
**Post date:** [June 27, 2020, 11:10pm UTC](https://forum.ansible.com/t/beginner-cant-complete-this-step/29438/4 "2020-06-27T23:10:30Z")

</div>

Yes! Worked like a charm for me also!  
I hoped I was close in my configurations following along with using Hands-on Ansible with Sander van Vugt  
when I got stuck. Unstuck now!

Thank you!
