mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-27 05:43:09 +00: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:
4
changelogs/fragments/306-ansible-2.9-compatibility.yml
Normal file
4
changelogs/fragments/306-ansible-2.9-compatibility.yml
Normal 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)."
|
||||
@@ -555,7 +555,13 @@ def main():
|
||||
msg='Unable to remove source file: %s' % to_native(e), exception=format_exc()
|
||||
)
|
||||
|
||||
file_args = module.load_file_common_arguments(params, path=b_dest)
|
||||
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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -233,7 +233,13 @@ def create_jks(module, name, openssl_bin, keytool_bin, keystore_path, password):
|
||||
|
||||
|
||||
def update_jks_perm(module, keystore_path):
|
||||
file_args = module.load_file_common_arguments(module.params, path=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
Reference in New Issue
Block a user