# User creation problem

**URL:** <https://forum.ansible.com/t/user-creation-problem/12993>\
**Category:** Ansible Project\
**Created:** [June 20, 2013, 9:50am UTC](https://forum.ansible.com/t/user-creation-problem/12993 "2013-06-20T09:50:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlo\_Bertoldi](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@Carlo\_Bertoldi](https://forum.ansible.com/u/Carlo_Bertoldi)\
**Post date:** [June 20, 2013, 9:50am UTC](https://forum.ansible.com/t/user-creation-problem/12993/1 "2013-06-20T09:50:47Z")

</div>

Hi,  
I’m having some troubles creating a user on a Debian host, using ansible 1.2.  
This is my action:  
action: user name=erlang comment=“Delibird user” group=staff shell=/bin/false createhome=no

action: user name=erlang groups=sudo

And this is the debug output:

TASK: [Create erlang user account] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
 REMOTE\_MODULE user name=erlang groups=sudo  
changed: [travis] =\> {“changed”: true, “comment”: “”, “createhome”: true, “group”: 1004, “groups”: “sudo”, “home”: “/home/erlang”, “item”: “”, “name”: “erlang”, “shell”: “/bin/sh”, “state”: “present”, “stderr”: “useradd: warning: the home directory already exists.\nNot copying any file from skel directory into it.\n”, “system”: false, “uid”: 1001}

Why are my settings almost completely ignored? I mean, it’s trying to create a home directory, wrong default shell and it also ignore the default group setting.

Thanks,  
Carlo

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [June 20, 2013, 4:02pm UTC](https://forum.ansible.com/t/user-creation-problem/12993/2 "2013-06-20T16:02:16Z")

</div>

So it looks like you have two action lines in your playbook, which is going to only do the last one since you are specifying a YAML hash.

I imagine you have it like this?

- action: user …  
action: user …

In which case you want this:

- action: user …
- action: user …

---

<div class="post-metadata">

**Author:** ![Carlo\_Bertoldi](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@Carlo\_Bertoldi](https://forum.ansible.com/u/Carlo_Bertoldi)\
**Post date:** [June 21, 2013, 8:39am UTC](https://forum.ansible.com/t/user-creation-problem/12993/3 "2013-06-21T08:39:16Z")

</div>

Bullseye 🙂  
Thanks,  
Carlo
