# Creating group and user

**URL:** <https://forum.ansible.com/t/creating-group-and-user/15044>\
**Category:** Ansible Project\
**Created:** [April 18, 2014, 12:53pm UTC](https://forum.ansible.com/t/creating-group-and-user/15044 "2014-04-18T12:53:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wojciech\_Pietrzak](https://avatars.discourse-cdn.com/v4/letter/w/7ab992/32.png) [@Wojciech\_Pietrzak](https://forum.ansible.com/u/Wojciech_Pietrzak)\
**Post date:** [April 18, 2014, 12:53pm UTC](https://forum.ansible.com/t/creating-group-and-user/15044/1 "2014-04-18T12:53:14Z")

</div>

Hi,

I’m trying to create a “www” group and a “web” user who should be a member of this “www” group.

`

```auto

---
- name: create group for deloyment and web
  group:
    state=present
    name=web
    system=yes
 
- name: create user for deployment and web
  user:
    state=present
    name=web
    group=www
    home=/home/web
    createhome=yes
    generate_ssh_key=yes
    ssh_key_bits=4096
    ssh_key_type=rsa
    ssh_key_comment="web user"

```

`

I got a error message, group www doesn’t exists, but it is present on the host when I ssh into the box after running this code.

Here is the error message:

`

```auto

PLAY [webservers] *************************************************************
 
GATHERING FACTS ***************************************************************
ok: [web.vagrant.box]
 
TASK: [deployment | create group for deloyment and web] ***********************
ok: [web.vagrant.box]
 
TASK: [deployment | create user for deployment and web] ***********************
failed: [web.vagrant.box] => {"failed": true, "item": ""}
msg: Group www does not exist
 
FATAL: all hosts have already failed -- aborting
 
PLAY RECAP ********************************************************************
           to retry, use: --limit @/Users/wopi/webserver.retry
 
web.vagrant.box : ok=2 changed=0 unreachable=0 failed=1

```

`

What is the cause ?

Regards,  
Wojciech

---

<div class="post-metadata">

**Author:** ![Adam\_Morris](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Adam\_Morris](https://forum.ansible.com/u/Adam_Morris)\
**Post date:** [April 18, 2014, 4:22pm UTC](https://forum.ansible.com/t/creating-group-and-user/15044/2 "2014-04-18T16:22:56Z")

</div>

Are sure? What you show creates a “web” group and a “web” user who is a member of the “www” group.

I would expect the error message that a www group doesn’t exist.

Adam
