Hi, I want to ensure that a directory and all its children belongs to a 
user/group. Normally I would do following with Ansible:

file:
 dest: /path/to/dir
 owner: userx
 group: groupx
 recurse: yes 


However this approach takes in my case about 10 minutes or more, because 
the folder contains recursively hundreds of subfolders and thousands of 
files. With the following approach this task takes me just seconds:

command: "chown -R userx:groupx /path/to/dir"
changed_when: false


Why is the Ansible native approach so much slower? Is it because it checks 
the state before/after the (possible) change? Or is there a faster good 
practice approach with Ansible?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f1aa9715-4ccc-4db4-b706-b83d9803d601%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to