# Creating a user with a dash in their username

**URL:** <https://forum.ansible.com/t/creating-a-user-with-a-dash-in-their-username/13729>\
**Category:** Ansible Project\
**Created:** [October 21, 2013, 2:26pm UTC](https://forum.ansible.com/t/creating-a-user-with-a-dash-in-their-username/13729 "2013-10-21T14:26:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![danrough](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/danrough/32/3541_2.png) [@danrough](https://forum.ansible.com/u/danrough)\
**Post date:** [October 21, 2013, 2:26pm UTC](https://forum.ansible.com/t/creating-a-user-with-a-dash-in-their-username/13729/1 "2013-10-21T14:26:24Z")

</div>

Hi there,

I understand that dashes are reserved. I’m wondering though if anybody else has had the need to create users, specifically system ones, that have a dash in their name. At the moment, I have an action that is similar to the below. It returns an error when I attempt to run the playbook that references it. Any ideas how I can do this?

- name: Create web user account  
user: name=www-data system=yes

Dan.

---

<div class="post-metadata">

**Author:** ![C\_Morgan\_Hamill](https://avatars.discourse-cdn.com/v4/letter/c/ebca7d/32.png) [@C\_Morgan\_Hamill](https://forum.ansible.com/u/C_Morgan_Hamill)\
**Post date:** [October 22, 2013, 12:51pm UTC](https://forum.ansible.com/t/creating-a-user-with-a-dash-in-their-username/13729/2 "2013-10-22T12:51:32Z")

</div>

Excerpts from Dan Rough's message of 2013-10-21 10:26:24 -0400:

> - name: Create web user account  
> &nbsp;&nbsp;user: name='www-data' system=yes

Should work.

---

<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:** [October 22, 2013, 2:41pm UTC](https://forum.ansible.com/t/creating-a-user-with-a-dash-in-their-username/13729/3 "2013-10-22T14:41:52Z")

</div>

I think this is a misunderstanding.

Dashes are totally fine in constants.

You just can’t use them in variable names (values are fine!)
