I\'d like to allow anyone to list and read all files in my directory tree, but I don\'t want to make the files executable :
dir
\\subdir1
file1
\\subdi
This worked for me:
- file:
path: dir
mode: a-x
recurse: yes
- file:
path: dir
mode: u=rwX,g=rX,o=rX
recurse: yes
Remove execution permission first from all, otherwise group and others get execution permission to files.
See chmod man pages about X-directive:
execute/search only if the file is a directory or already has execute permission for some user (X)
Also this works:
- shell: "chmod -R a-x,u=rwX,g=rX,o=rX dir"
For some reason combination of these two does not work:
- file:
path: dir
mode: a-x,u=rwX,g=rX,o=rX
recurse: yes