Skip to content

Support for ansible-core >= 2.12.0 #874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
amenzhinsky opened this issue Nov 15, 2021 · 7 comments · Fixed by #883
Closed

Support for ansible-core >= 2.12.0 #874

amenzhinsky opened this issue Nov 15, 2021 · 7 comments · Fixed by #883
Labels
affects-0.3 Issues related to 0.3.X Mitogen releases feature Design and functional additions

Comments

@amenzhinsky
Copy link

I'm very glad that the support for 2.11 just got mainlined, but 2.12 is already out:

ERROR! Your Ansible version ((2, 12, 0)) is too recent. The most recent version
supported by Mitogen for Ansible is (2, 11).x. Please check the Mitogen
release notes to see if a new version is available, otherwise
subscribe to the corresponding GitHub issue to be notified when
support becomes available.

    https://mitogen.rtfd.io/en/latest/changelog.html
    https://github.com/mitogen-hq/mitogen/issues/
@amenzhinsky amenzhinsky added affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome labels Nov 15, 2021
@moreati moreati added feature Design and functional additions and removed bug Code feature that hinders desired execution outcome labels Nov 15, 2021
@moreati
Copy link
Member

moreati commented Nov 15, 2021

Ansible 5.x, which is not out yet, will require ansible-core 2.12. Ansible 4.x will continue to require ansible-core 2.11. So this won't be a high priority for me for at least a month or 2. However, patches with tests are welcome.

@jauderho
Copy link

jauderho commented Dec 1, 2021

FWIW, Ansible 5.0.1 is now out.

@zerwes
Copy link
Contributor

zerwes commented Dec 7, 2021

we are updating our complete ansible infrastructure at the moment from 2.9 to the current ansible community version (5.0 = core 2.12)
We have been using mitogen w/ ansible for a log time.
Some playbooks take quite long now (factor * 8) now on the 2.12 version. And the lack of support is currently a showstopper.
So I have a huge interest and am willing to do some tests.

zerwes pushed a commit to Rosa-Luxemburgstiftung-Berlin/mitogen that referenced this issue Dec 7, 2021
@zerwes
Copy link
Contributor

zerwes commented Dec 7, 2021

first test using https://github.com/Rosa-Luxemburgstiftung-Berlin/mitogen/tree/pr-ansible2.12 work well ... seems that mitogen is well prepared for ansible 2.12

zerwes pushed a commit to Rosa-Luxemburgstiftung-Berlin/mitogen that referenced this issue Dec 8, 2021
zerwes pushed a commit to Rosa-Luxemburgstiftung-Berlin/mitogen that referenced this issue Dec 8, 2021
zerwes pushed a commit to Rosa-Luxemburgstiftung-Berlin/mitogen that referenced this issue Dec 8, 2021
@extmind
Copy link
Contributor

extmind commented Dec 8, 2021

Changing the supported version works for me, too. However, I didn't receive the intended error message before the change (as in the first post here), but rather the following:

ERROR! Unexpected Exception, this is probably a bug: name 'ansible' is not defined
the full traceback was:

Traceback (most recent call last):
  File "/usr/bin/ansible", line 128, in <module>
    exit_code = cli.run()
  File "/usr/lib/python3.9/site-packages/ansible/cli/adhoc.py", line 172, in run
    result = self._tqm.run(play)
  File "/usr/lib/python3.9/site-packages/ansible/executor/task_queue_manager.py", line 297, in run
    strategy = strategy_loader.get(new_play.strategy, self)
  File "/usr/lib/python3.9/site-packages/ansible/plugins/loader.py", line 807, in get
    return self.get_with_context(name, *args, **kwargs).object
  File "/usr/lib/python3.9/site-packages/ansible/plugins/loader.py", line 827, in get_with_context
    self._module_cache[path] = self._load_module_source(name, path)
  File "/usr/lib/python3.9/site-packages/ansible/plugins/loader.py", line 791, in _load_module_source
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File ".../mitogen/ansible_mitogen/plugins/strategy/mitogen_linear.py", line 55, in <module>
    import ansible_mitogen.loaders
  File ".../mitogen/ansible_mitogen/loaders.py", line 86, in <module>
    assert_supported_release()
  File ".../mitogen/ansible_mitogen/loaders.py", line 78, in assert_supported_release
    raise ansible.errors.AnsibleError(
NameError: name 'ansible' is not defined

That could be fixed by adding from ansible.errors import AnsibleError and then using raise AnsibleError(....

@amenzhinsky
Copy link
Author

Bumped max supported version with sed -i 's/ANSIBLE_VERSION_MAX = (2, 11)/ANSIBLE_VERSION_MAX = (2, 12)/' /usr/lib/python3.9/site-packages/ansible_mitogen/loaders.py

Everything seems to be working in a medium size project (builtin, podman, grafana collections)

@shurrman
Copy link

Setting max version to 2.12 (I have 2.12.1) yeilded an error:
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: __init__() got an unexpected keyword argument 'collection_list' fatal: [mtm]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-0.3 Issues related to 0.3.X Mitogen releases feature Design and functional additions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants