# File - can't create directories due to allegedly missing users

**URL:** <https://forum.ansible.com/t/file-cant-create-directories-due-to-allegedly-missing-users/42645>\
**Category:** Get Help\
**Created:** [May 14, 2025, 10:58am UTC](https://forum.ansible.com/t/file-cant-create-directories-due-to-allegedly-missing-users/42645 "2025-05-14T10:58:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dulhaver](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dulhaver/32/1061_2.png) [@dulhaver](https://forum.ansible.com/u/dulhaver)\
**Post date:** [May 14, 2025, 10:58am UTC](https://forum.ansible.com/t/file-cant-create-directories-due-to-allegedly-missing-users/42645/1 "2025-05-14T10:58:41Z")

</div>

I have this TASK which fails with

```auto
TASK [etcd : create directories] *****************************************************************************************************
failed: [dvzsn-rd5428.ref.dbinfra.portal.cn-mv.de] (item=/opt/custom/etcd/install/test_ansible) => {"ansible_loop_var": "item", "changed": false, "gid": 50000, "group": "etcd", "item": "/opt/custom/etcd/install/test_ansible", "mode": "0755", "msg": "chown failed: failed to look up user etdcd", "owner": "etcd", "path": "/opt/custom/etcd/install/test_ansible", "secontext": "unconfined_u:object_r:usr_t:s0", "size": 6, "state": "directory", "uid": 50000}

```

```auto
- name: create directories
  ansible.builtin.file:
    path: "{{ item }}"
    owner: etdcd
    group: etdcd
    mode: 0700
    state: directory
  become: true
  become_user: etcd
  loop:
    - "{{ etcd_install }}"
    - "{{ etcd_conf_dir }}"

```

however the `user` and `group` do actually exist locally

```auto
etcd@dvzsn-rd5428:/opt/custom/etcd> grep etcd /etc/{passwd,group}
/etc/passwd:etcd:x:50000:50000:etcd User:/home/etcd:/bin/bash
/etc/group:etcd:x:50000:
/etc/group:etcdadm:x:45096:etcd,user1,user2, ...

```

what is the mistake I am apparently making here?

I suspect selinux being involved.

---

<div class="post-metadata">

**Author:** ![iwt-cmd](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iwt-cmd/32/9120_2.png) [@iwt-cmd](https://forum.ansible.com/u/iwt-cmd)\
**Post date:** [May 14, 2025, 12:03pm UTC](https://forum.ansible.com/t/file-cant-create-directories-due-to-allegedly-missing-users/42645/2 "2025-05-14T12:03:15Z")

</div>

Hi @dulhaver

Looks like there’s an extra “d” in the owner and group entered.

 ![image](https://us1.discourse-cdn.com/ansible/original/2X/7/7639a0a7906eca0c2c4fdf75139d5a39a08aae72.png)

Best regards,

Joe

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [June 13, 2025, 12:03pm UTC](https://forum.ansible.com/t/file-cant-create-directories-due-to-allegedly-missing-users/42645/3 "2025-06-13T12:03:29Z")

</div>

Closed on June 13, 2025, 12:03pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
