diff --git a/changelogs/fragments/find_enoent.yml b/changelogs/fragments/find_enoent.yml new file mode 100644 index 00000000000..7fa780cd35b --- /dev/null +++ b/changelogs/fragments/find_enoent.yml @@ -0,0 +1,5 @@ +--- +bugfixes: + - find - skip ENOENT error code while recursively enumerating files. + find module will now be tolerant to race conditions that remove files or directories + from the target it is currently inspecting. (https://github.com/ansible/ansible/issues/84873). diff --git a/lib/ansible/modules/find.py b/lib/ansible/modules/find.py index 8c2820c48e7..2869be1112e 100644 --- a/lib/ansible/modules/find.py +++ b/lib/ansible/modules/find.py @@ -515,7 +515,7 @@ def main(): skipped = {} def handle_walk_errors(e): - if e.errno in (errno.EPERM, errno.EACCES): + if e.errno in (errno.EPERM, errno.EACCES, errno.ENOENT): skipped[e.filename] = to_text(e) return raise e