Commit Graph

100 Commits (6f903b28deba597615dca133e222f33cddb3b8e6)

Author SHA1 Message Date
Jonathan Rosser 06617f8231 ansible_mitogen: Handle unsafe paths in _remote_chmod
This is missing from b822f20007
1 year ago
Alex Willmer 357fe38766 Ansible 10 (ansible-core 2.17) support
Notably
- Python 2.7 and 3.6 are no longer supported by Ansible on targets
- The yum module has been removed, and redirected to dnf
- _INTERPRETER_PYTHON_DISTRO_MAP has been neutered. Interpreter discovery
  always favours specific `python3.<x>` interpreters in decending version
  order, then generic `python3` or `python`.
- Add the ability for an action plugin to call self._execute_module(*,
  ignore_unknown_opts=True) to execute a module with options that may not be
  supported for the version being called.

https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_10.html
https://github.com/ansible-community/ansible-build-data/blob/main/10/CHANGELOG-v10.md
https://github.com/ansible/ansible/blob/stable-2.17/changelogs/CHANGELOG-v2.17.rst

fixes #1074, refs #1082

Co-authored-by: Claude Becker <becker@phys.ethz.ch>
1 year ago
Alex Willmer b822f20007 ansible_mitogen: Handle AnsibleUnsafeText et al in Ansible >= 7
Follwing fixes in Ansible 7-9 for CVE-2023-5764 cating `AnsibleUnsafeBytes` &
`AnsibleUnsafeText` to `bytes()` or `str()` requires special handling. The
handling is Ansible specific, so it shouldn't go in the mitogen package but
rather the ansible_mitogen package.

`ansible_mitogen.utils.unsafe.cast()` is most like `mitogen.utils.cast()`.
During development it began as `ansible_mitogen.utils.unsafe.unwrap_var()`,
closer to an inverse of `ansible.utils.unsafe_procy.wrap_var()`. Future
enhancements may move in this direction.

refs #977, refs #1046

See also
- https://github.com/advisories/GHSA-7j69-qfc3-2fq9
- https://github.com/ansible/ansible/pull/82293
- https://github.com/mitogen-hq/mitogen/wiki/AnsibleUnsafe-notes
2 years ago
Alex Willmer 31b3a4eb4a ansible_mitogen: Standardise __future__ imports to match Ansible
Some modules additionally enable unicode_literals (which Ansible doesn't do).
I've chosen not to change that, for now.
4 years ago
Alex Willmer d9b8d50d4e Fix ansible.__version__ comparisons with multi-digit components
Ansible 2.8 is older than Ansible 2.10, but `'2.8' < '2.10' == False`
4 years ago
Steven Robertson e30e84334e remove synchronize fail test for azure 5 years ago
Steven Robertson 139b9560bc print didn't work because verbosity, throw valueerror to see 5 years ago
Steven Robertson 9bd35adcfb more debugging, synchronize is being weird on azure 5 years ago
Steven Robertson ff8a276186 turn off failing Ansible-only tests for now, also raising errors to see what Azure is gonna do with collections 5 years ago
Steven Robertson 41a13ebce2 hopefully this also fails the same way 5 years ago
Steven Robertson 5aedb5f157 add missing collections 🤦 5 years ago
Steven Robertson 9857dfea5c verify collection is working as expected 5 years ago
Steven Robertson a40c28d93f can't replicate but think it's because synchronize is now a collection 5 years ago
Steven Robertson 49dd8eee1a figure out what synchronize is now 5 years ago
Steven Robertson c6d42212dd add some debugging info, was able to run the failed synchronize test locally just fine using test framework, not sure what's going on 5 years ago
Steven Robertson f91cbf4d00 test cleanup and trying to replicate synchronize fails 5 years ago
Steven Robertson f994807d74 ansible 2.10 renamed ping module to reflect legacy builtin collection 5 years ago
Steven Robertson 03438271bb able to remove the hack on ActionBase after all 5 years ago
Steven Robertson 583f540889 added comments 5 years ago
Steven Robertson ddc1eebec8 able to load collection but the mitogen master proc was unable to serve it 6 years ago
Steven Robertson e99d63f4fc able to load collections but they don't do anything because no actionmodulemixin, need to tweak how this works 6 years ago
Steven Robertson acde13f9d6 handles a 'wait_for_connection' call right after a task caused a shutdown 6 years ago
Steven Robertson 5bf327649f add missing / to python paths 6 years ago
Steven Robertson 7411057ba8 adding in python3 as a possible_pythons option for rhel8 6 years ago
Steven Robertson 89d87445c8 able to pass tests running interpreter detection in rhel8 container 6 years ago
Steven Robertson 7d6d76e444 trying to get docker rhel8 working on a Mac host 6 years ago
Steven Robertson ee310c1a68 remove_internal_keys returns None, so need different way to check fallback 6 years ago
Steven Robertson 722cf0ea8d handle ansible 2.3.3 remove_internal_keys 6 years ago
Steven Robertson ba350aa6cf assigned interpreter vars to the wrong class 6 years ago
Steven Robertson d74da84f62 the clean module was added later 6 years ago
Steven Robertson ff2fa60184 fixed typo 6 years ago
Steven Robertson 0b57332d75 all test cases for ansible_python_interpreter on OSX pass now 6 years ago
Steven Robertson af1e22d4e1 able to propagate ansible_python_interpreter fact but still doesn't save between task runs 6 years ago
Steven Robertson a6d2b2cd90 doesn't error when declaring 'ansible_python_interpreter: auto' but fact isn't being cached 6 years ago
Steven Robertson d64adb15d7 reverted autolinted code 6 years ago
Steven Robertson e8f3154cab Merge branch 'master' into complexAnsiblePythonInterpreterArg 6 years ago
David Wilson d6329f3446 Merge devel/290 @ 79b979ec8544ef5d8620c64068d4a42fabf50415 6 years ago
Steven Robertson 4669c8774f handles templating ansible_python_interpreter values 6 years ago
David Wilson 8dfb3966df issue #558, #582: preserve remote tmpdir if caller did not supply one
The undocumented 'tmp' parameter controls whether _execute_module()
would delete anything on 2.3, so mimic that. This means
_execute_remove_stat() calls will not blow away the temp directory,
which broke the unarchive plugin.
6 years ago
David Wilson c80fddd487 [linear2]: merge fallout flaggged by LGTM 6 years ago
David Wilson 6309774be2 issue #554: fix Ansible 2.4 compatibility 7 years ago
David Wilson 7743e57ff3 issue #554: track and remove multiple make_tmp_path() calls. 7 years ago
David Wilson 1f77d24bec Update copyright year everywhere. 7 years ago
David Wilson 97f3cfe4f4 issue #477: target.file_exists() wrapper.
os.path.exists physical module name varies across major Python versions.
7 years ago
David Wilson bcc7bb7128 issue #61: unused import (reported by LGTM) 7 years ago
David Wilson 9401c34f64 issue #461: Ansible 2.3 did not have _load_name. 7 years ago
David Wilson 1b17aa1d1a ansible: fix temp cleanup regression and add test; closes #397. 7 years ago
David Wilson 5521945bd2 ansible: temporary files take 5. 7 years ago
David Wilson 9ff34afafe ansible: fix regression. 7 years ago
David Wilson e241081cae ansible: stop sharing target temp_dir in runner.
This cannot work with delegate_to, since delegate_to permits multiple
concurrent tasks to be executing on the same target.
7 years ago