# Possible bug: Using file to create directories recursively does not ensure owner/group

**URL:** <https://forum.ansible.com/t/possible-bug-using-file-to-create-directories-recursively-does-not-ensure-owner-group/21319>\
**Category:** Ansible Project\
**Created:** [May 1, 2016, 9:07am UTC](https://forum.ansible.com/t/possible-bug-using-file-to-create-directories-recursively-does-not-ensure-owner-group/21319 "2016-05-01T09:07:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [May 1, 2016, 9:07am UTC](https://forum.ansible.com/t/possible-bug-using-file-to-create-directories-recursively-does-not-ensure-owner-group/21319/1 "2016-05-01T09:07:48Z")

</div>

Hi all,

using this snipped creates the directories foo, bar and xyz with the  
correct owner.

- name: Create directories  
&nbsp;&nbsp;file: dest=/foo/bar/xyz owner=0 group=0 mode=0755 state=directory  
recurse=yes

If a directory does exist prior to running the playbook, this  
directory is not touched and owner/group different from those state in  
the play are not changed.

Is this intentional? Am I missing a parameter apart from recurse=yes?

Thanks in advance,

Johannes

P.S.: I am running ansible 2.0.1.0 on OSX 10.10, target host was a  
linux machine.
