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
40695f413b
ansible_mitogen: Respect ansible_facts.discovered_interpreter_python more
...
fixes #1097
1 year ago
Alex Willmer
9185805bf2
ansible_mitogen: cast ansible_python_interpreter value
...
This was the last remaining use of `mitogen.utils.cast()`. I missed it in
#1046 .
1 year ago
Philippe Kueck
ec05e542b4
Fix 'ansible_host_key_checking' and 'ansible_ssh_host_key_checking' for
...
adding new hosts to the inventory using 'add_hosts'
Co-authored-by: Alex Willmer <alex@moreati.org.uk>
2 years ago
Alex Willmer
4996ec2f09
ansible_mitogen: Fix "filedescriptor out of range in select()" in WorkerProcess
...
`mitogen.parent.POLLER_LIGHTWEIGHT` will normally be `PollPoller`, falling
back to `EpollPoller`, `KqueuePoller`, or `Poller`.
Fixes #957
Co-authored-by: Luca Berruti <nadirio@gmail.com>
Co-authored-by: Philippe Kueck <bqobccy6ejnq2bqvmebqiwqha4cs4@protected32.unixadm.org>
2 years ago
Alex Willmer
d5e9186289
ansible_mitogen: Fix --ask-become-pass, add test coverage
...
Previously f1503874de fixed the priority of
ansible_become_pass over ansible_become_password, but broke --ask-become-pass.
Fixes #952 .
2 years ago
Alex Willmer
cca651da1f
ansible_mitogen: Ansible 9 (ansible-core 2.16) support
2 years ago
Alex Willmer
fa1d21747f
ansible_mitogen: Declare Ansible 8 (ansible-core 2.15) support
...
refs #1021
2 years 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
813f253d6b
ansible_mitogen: Make ansible_mitogens.utils a package
...
Prep work for ansible_mitogen.utils.unsafe
2 years ago
Orion Poplawski
dfc3c7d516
ansible_mitogen: Add Ansible 7 support
...
Co-authored-by: Orion Poplawski <orion@nwra.com>
2 years ago
Alex Willmer
fe8a3a71fc
ansible_mitogen: Remove use of distutils, which was removed in Python 3.12
2 years ago
Alex Willmer
5ad3d14ceb
mitogen: Support PEP 451 ModuleSpec API, required for Python 3.12
...
importlib.machinery.ModuleSpec and find_spec() were introduced in Python 3.4
under PEP 451. They replace the find_module() API of PEP 302, which was
deprecated from Python 3.4. They were removed in Python 3.12 along with the
imp module.
This change adds support for the PEP 451 APIs. Mitogen should no longer import
imp on Python versions that support ModuleSpec. Tests have been added to cover
the new APIs.
CI jobs have been added to cover Python 3.x on macOS.
Refs #1033
Co-authored-by: Witold Baryluk <witold.baryluk@gmail.com>
2 years ago
Alex Willmer
fc3e788cb4
non functional: Add comments about imp module removal in Python 3.12
2 years ago
InsanePrawn
317a2abd57
ansible_mitogen: correct typo in MitogenViaSpec.mitogen_lxc_path()
...
self.host_vars -> self._host_vars
3 years ago
Alex Willmer
1871f2a9b1
Remove vendored mitogen.compat.simplejson
...
Python 2.6 added json to the stdlib. We no longer support Python <= 2.7 in
Mitogen 0.3.x, so this fallback is unneeded complexity. Fixes #659
3 years ago
Alex Willmer
0af2ce8c30
Remove ansible_mitogen Connection.close() workaround
...
Refs #925 #969
I'm not 100% confident that merely removing this is the full fix,
without substituting something else. I am sure keeping it would be
the greater of two evils. __del__() should be avoided on general
principal, and it's associated with multiple intermittant CI
failures, plus multiple user reported issues.
3 years ago
Artem Nistratov
00dab14111
add SSH args into options documentation
3 years ago
Alex Willmer
f1503874de
ansible_mitogen: Correct ansible_become_pass/ansible_become_password precendence
...
Until Ansible 2.9 it looks like ansible_become_password had higher priority.
From Ansible 2.10 ansible_become_pass has higher priority [1]. Mitogen was not
respecting this.
I may need to rework this further, instatiating the become plugin may have
slowed down execution.
[1] Based on testing with
```
[ubuntus]
become-pass-pass ansible_become_pass=1234
become-pass-password ansible_become_password=1234
become-pass-both ansible_become_password=wrong ansible_become_pass=1234
[ubuntus:vars]
ansible_host=ubuntu2004.local
ansible_user=ubuntu
```
```
- hosts: ubuntus
gather_facts: false
become: true
tasks:
- ping:
```
3 years ago
Alex Willmer
e8ad12e881
Ansible 6 support
...
fixes #929
3 years ago
David Mehren
a30a743ce7
Add ansible.builtin.dnf to ALWAYS_FORK_MODULES
...
The new fully qualified name of the DNF module needs to also be added to the list.
Fixes #832
4 years ago
Alex Willmer
25ea6dde02
ansible_mitogen: Allow mitogen_fetch to bypass slurp module
...
This reapplies an earlier change, when this plugin was first introduced to
Mitogen. The plugin was updated to fix
[DEPRECATION WARNING]: The '_remote_checksum()' method is deprecated.
I've elected to short-circuit the if statemtn logic, rather than
deleting/unindenting, to make the code delta much smaller. This should make it
easier to maintain/update.
Fixes #915
4 years ago
Alex Willmer
0ff9c6e579
ansible_mitogen: Replace fetch action plug from upstream
...
From
be0cdc0ea2/lib/ansible/plugins/action/fetch.py
4 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
109feec6d5
Fix lints found by flake8
4 years ago
Alex Willmer
18c89de5a9
Remove unused module imports
4 years ago
Alex Willmer
96e20a09d6
ansible_mitogen: Add podman connection plugin
4 years ago
Alex Willmer
1287d58a54
Use with open(): ... to ensure file objects get closed
4 years ago
Klaus Zerwes
6fb5502a35
issue #874 support for ansible core 2.12 aka. ansible community 5.0
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
Alex Willmer
465ac8abff
ansible: Fix AttributeError in kubectl connection
4 years ago
Alex Willmer
e194a6367f
ci: Fix version comparisons involving double digits
...
See https://gist.github.com/moreati/e7507c5b606b12ec0ddafcb7c8debbf1
4 years ago
Alex Willmer
c61c063b4f
Support for Ansible 3 & 4
...
fixes #834
Co-authored-by: Claude Becker (@upekkha)
Co-authored-by: Dolph Mathews (@dolph)
4 years ago
Alex Willmer
2382d8dab5
Merge branch 'master' into issue_827_collections
4 years ago
Antti Jaakkola
ee6f2b09b9
Fix for load_plugins() called twice error with dnf
4 years ago
Philippe Kueck
a2dcedabda
fixes #827
...
some ansible collections write their own module classes derived from
ansible.module_utils.basic.AnsibleModule, thus lacking that import
in the plugin file. NewStylePlanner was unable to detect these plugins
as Ansiballz.
This commit extends the search pattern for NewStylePlanner to also
detect ansible_collections imports.
4 years ago
Steven Robertson
234dde5fc1
check Ansible version before loaders are loaded
5 years ago
Steven Robertson
ba222744af
Merge branch 'master' into add0.2.10+0.3.0changelog
5 years ago
MarkusTeufelberger
8d3026b109
Add ansible.legacy.setup to be fixed on py3.5
5 years ago
Steven Robertson
f489478127
code cleanup + adds 0.2.10 + 0.3.0 changelog
5 years ago
Steven Robertson
2510f1a2c2
fix py3.5.1-3.5.3 setup import error for Ansible 2.10
5 years ago
Steven Robertson
5a0da02e6c
code review changes, using when statements and adding trailing comma
5 years ago
Steven Robertson
196a476270
🎉 no more warnings, only load specific collection subdirs instead of top-level collection path (ie no ansible_collections/google, only ansible_collections/google/cloud, etc)
5 years ago
Steven Robertson
741e99f698
ansible 2.10 no longer has a at the end of the error msg... 🤦
5 years ago
Steven Robertson
95c43ec9fc
fixed issue of switching between mitogen and non-mitogen strategies
5 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
f757dbcb82
removed duplicate install and added debug dump of collection loading to see what tests are doing
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
5215646c8a
code cleanup
5 years ago
Steven Robertson
0b421e0d3c
able to run docker_container installed via 'ansible-galaxy collection install community.general'
5 years ago
Steven Robertson
45797a0d34
able to send collections paths to master with very little change to core Mitogen, need to ensure imports work properly now though
5 years ago
Steven Robertson
6e51f1a184
found a way to load collections without affecting mitogen core code
5 years ago
Steven Robertson
8d3ee26079
code cleanup
5 years ago
Steven Robertson
ca94751f15
remove hack
5 years ago
Steven Robertson
f1bdc39047
added note about breaking backwards compat
5 years ago
Steven Robertson
1d13df718a
connection_loader.get isn't called anymore, it's connection_loader.get_with_context now
5 years ago
Steven Robertson
6ba08097b6
more notes, strategy plugin is being called but Mitogen's method overrides aren't being triggered
5 years ago
Steven Robertson
ca4e8116b7
TODO: turns out ansible 2.10 doesn't run Mitogen like it used to; was running old ansible version before because ansible-base didn't override everything. Did a fresh uninstall of ansible and installed 2.10.0 and Mitogen's connection monkeypatching isn't working
5 years ago
Steven Robertson
1bd4b8afcd
much thinking needs to be done regarding how to handle not requiring sshpass...
5 years ago
Steven Robertson
6ac9168d55
need to get around sshpass check here somehow: https://github.com/ansible/ansible/blob/v2.10.0/lib/ansible/plugins/connection/ssh.py#L577
5 years ago
Steven Robertson
583f540889
added comments
5 years ago
Steven Robertson
e34cf8667f
Merge branch 'master' into collectionsSupport
5 years ago
Steven Robertson
81076c9da8
fixes setup module relative import fail on some pythons
6 years ago
Steven Robertson
376d8d0fab
remove old hacks; ansible_collections is available at time of invoker but not later
6 years ago
Steven Robertson
955e77c5db
WIP: able to load subdirs but now need to treat them as submodules properly
6 years ago
Steven Robertson
ab55d05267
all in on ansible 2.10+ for collections support
6 years ago
Steven Robertson
c92a9ace41
bump max ansible version
6 years ago
Steven Robertson
ac1e72eec4
Merge branch 'master' into collectionsSupport
6 years ago
Steven Robertson
e632310fc4
no tmpdir to remove for old ansible versions in fetch command
6 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
389cee8c70
fix assertion of python_path, it should be always what 'discovered_interpreter' is
6 years ago
Steven Robertson
c959ce010b
created temp action obj for 'meta: reset_connection' python interpreter discovery
6 years ago
Steven Robertson
5b8c9da769
_execute_meta doesn't have an Action nooooo this breaks 'meta: reset_connection' because interpreter_discovery needs an Action
6 years ago
Steven Robertson
33e7d0804f
fixed tests, and removed the action hack code
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
5e0fb902b2
fix lambda args for fallback
6 years ago
Steven Robertson
91785f8862
fix another bad import
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
cf1c3aac1c
fix typo
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
496d96c01a
need to convert to str because of unicode_literals
6 years ago