Ansible 2.9 tests (#14)

* Add CI group 2 for Ansible 2.9 tests.

* Temporarily disable some nodes.

* Fix ignore.txt.

* Use version prefix instead of groups.

* Ansible 2.9 doesn't support Python 3.9

ci_complete

* Make Ansible 2.9 compatible.

* Replace archive/unarchive with copy.

* Remove dependency on community.general in integration tests for Ansible 2.9.

* Let's see.

* Ansible 2.9's copy doesn't create directories.

* Re-enable no dependency.

ci_complete

* path should be bytes.

* Reenable nodes, add two more.

* Force complete CI run for Ansible 2.9.

* Used wrong variable.

* Fix Ansible 2.9 compatibility...
This commit is contained in:
Felix Fontein
2020-04-01 11:35:43 +02:00
committed by GitHub
parent 4d157b93ee
commit 6b3ca2ca07
6 changed files with 76 additions and 42 deletions

View File

@@ -418,7 +418,14 @@ def write_file(module, content, default_mode=None, path=None):
Uses file arguments from module.
'''
# Find out parameters for file
file_args = module.load_file_common_arguments(module.params, path=path)
try:
file_args = module.load_file_common_arguments(module.params, path=path)
except TypeError:
# The path argument is only supported in Ansible 2.10+. Fall back to
# pre-2.10 behavior of module_utils/crypto.py for older Ansible versions.
file_args = module.load_file_common_arguments(module.params)
if path is not None:
file_args['path'] = path
if file_args['mode'] is None:
file_args['mode'] = default_mode
# Create tempfile name