1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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
parent 5cdb646ab7
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

@ -0,0 +1,4 @@
bugfixes:
- "archive - make module compatible with older Ansible versions (https://github.com/ansible-collections/community.general/pull/306)."
- "maven_artifact - make module compatible with older Ansible versions (https://github.com/ansible-collections/community.general/pull/306)."
- "java_keystore - make module compatible with older Ansible versions (https://github.com/ansible-collections/community.general/pull/306)."

View file

@ -555,7 +555,13 @@ def main():
msg='Unable to remove source file: %s' % to_native(e), exception=format_exc()
)
try:
file_args = module.load_file_common_arguments(params, path=b_dest)
except TypeError:
# The path argument is only supported in Ansible 2.10+. Fall back to
# pre-2.10 behavior for older Ansible versions.
params['path'] = b_dest
file_args = module.load_file_common_arguments(params)
if not check_mode:
changed = module.set_fs_attributes_if_different(file_args, changed)

View file

@ -654,7 +654,13 @@ def main():
except ValueError as e:
module.fail_json(msg=e.args[0])
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,

View file

@ -233,7 +233,13 @@ def create_jks(module, name, openssl_bin, keytool_bin, keystore_path, password):
def update_jks_perm(module, keystore_path):
try:
file_args = module.load_file_common_arguments(module.params, path=keystore_path)
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'] = keystore_path
file_args = module.load_file_common_arguments(module.params)
module.set_fs_attributes_if_different(file_args, False)

File diff suppressed because it is too large Load diff