fetch: set fail_on_missing: True as default as per docs (#36469)

* fetch: set fail_on_missing: True as default as per docs

* Updated docs for fetch to say behaviour was changed in 2.5 and updated tests
This commit is contained in:
Jordan Borean 2018-02-21 18:10:23 +10:00 committed by GitHub
commit df8a5d7a4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 6 deletions

View file

@ -41,9 +41,9 @@ options:
version_added: "1.1"
description:
- 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
read for any reason. Prior to Ansible-2.5, setting this would only fail
if the source file was missing.
- The default was changed to "yes" in Ansible-2.4.
- The default was changed to "yes" in Ansible-2.5.
required: false
choices: [ "yes", "no" ]
default: "yes"
@ -73,8 +73,8 @@ 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+,
- Prior to Ansible-2.5 this module would not fail if reading the remote
file was impossible unless fail_on_missing was set. In Ansible-2.5+,
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.

View file

@ -54,7 +54,7 @@ class ActionModule(ActionBase):
source = self._task.args.get('src', None)
dest = self._task.args.get('dest', None)
flat = boolean(self._task.args.get('flat'), strict=False)
fail_on_missing = boolean(self._task.args.get('fail_on_missing'), strict=False)
fail_on_missing = boolean(self._task.args.get('fail_on_missing', True), strict=False)
validate_checksum = boolean(self._task.args.get('validate_checksum',
self._task.args.get('validate_md5', True)),
strict=False)