Improve Ansible 2.9 compatibility (#306)

* Adjust ignore-2.9.txt.

* Workaround for load_file_common_arguments's path option (similar to ansible-collections/community.crypto#14).

* Add changelog.
This commit is contained in:
Felix Fontein 2020-05-08 15:38:23 +02:00 committed by GitHub
commit 85cbc27427
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 1402 additions and 3400 deletions

View file

@ -654,7 +654,13 @@ def main():
except ValueError as e:
module.fail_json(msg=e.args[0])
file_args = module.load_file_common_arguments(module.params, path=dest)
try:
file_args = module.load_file_common_arguments(module.params, path=dest)
except TypeError:
# The path argument is only supported in Ansible 2.10+. Fall back to
# pre-2.10 behavior for older Ansible versions.
module.params['path'] = dest
file_args = module.load_file_common_arguments(module.params)
changed = module.set_fs_attributes_if_different(file_args, changed)
if changed:
module.exit_json(state=state, dest=dest, group_id=group_id, artifact_id=artifact_id, version=version, classifier=classifier,