Make fetch default to fail on errors

Fixes #23501
This commit is contained in:
Toshio Kuratomi 2017-04-17 10:55:56 -07:00
parent 90a229c793
commit a0dfa8616a
5 changed files with 48 additions and 18 deletions

View file

@ -27,9 +27,7 @@ short_description: Fetches a file from remote nodes
description:
- This module works like M(copy), but in reverse. It is used for fetching
files from remote machines and storing them locally in a file tree,
organized by hostname. Note that this module is written to transfer
log files that might not be present, so a missing remote file won't
be an error unless fail_on_missing is set to 'yes'.
organized by hostname.
version_added: "0.2"
options:
src:
@ -50,10 +48,13 @@ options:
fail_on_missing:
version_added: "1.1"
description:
- When set to 'yes', the task will fail if the source file is missing.
- When set to 'yes', the task will fail if the remote file cannot be
read for any reason. Prior to Ansible-2.4, setting this would only fail
if the source file was missing.
- The default was changed to "yes" in Ansible-2.4.
required: false
choices: [ "yes", "no" ]
default: "no"
default: "yes"
validate_checksum:
version_added: "1.4"
description:
@ -80,6 +81,11 @@ notes:
depending on the file size can consume all available memory on the
remote or local hosts causing a C(MemoryError). Due to this it is
advisable to run this module without C(become) whenever possible.
- Prior to Ansible-2.4 this module would not fail if reading the remote
file was impossible unless fail_on_missing was set. In Ansible-2.4+,
playbook authors are encouraged to use fail_when or ignore_errors to
get this ability. They may also explicitly set fail_on_missing to False
to get the non-failing behaviour.
'''
EXAMPLES = '''