Fix for file module with recursive permission setting and broken symlinks

There was a traceback when setting permissions on a directory tree when
there were broken symlinks inside of the tree and follow=true.  chmod -R
ignores broken symlinks inside of the tree so we've fixed the file
module to do the same.

Fixes #39456
This commit is contained in:
Toshio Kuratomi 2018-05-02 14:38:25 -07:00
parent 4f664f8ff6
commit 6b159fdb03
3 changed files with 20 additions and 5 deletions

View file

@ -636,6 +636,9 @@
- name: create a symlink to the directory
file: path={{output_dir}}/test_follow_rec/test_link_dir state=link src="../test_follow_rec_target_dir"
- name: create a symlink to a nonexistent file
file: path={{output_dir}}/test_follow_rec/nonexistent state=link src=does_not_exist force=True
- name: try to change permissions without following symlinks
file: path={{output_dir}}/test_follow_rec follow=False mode="a-x" recurse=True