mitogen
mitogen copied to clipboard
simplified module names not working
Hi all,
while converting all my playbooks, plugins and stuff to ansible 2.10+ I found that simplified module names won't work with mitogen and 3rdparty modules. FQCN work, though. Simplified names of "common" collections like community.general
also work, because there's a plugin_routing
for those modules hardcoded in ansible itself.
- ansible version: 2.10.6
- mitogen version: v0.3.0rc1 and master
- python version: 3.9.2 (
/usr/bin/python
is a symlink to/usr/bin/python3
) - os: Fedora 33
For this bug report I created two repositories, one for the collection and one for the playbook examples.
To reproduce, follow these steps:
# fetch the latest stable ansible 2.10 version
git clone --depth 1 -b v2.10.6 https://github.com/ansible/ansible.git /var/tmp/ansible2106
# setup environment
. /var/tmp/ansible2106/hacking/env-setup
# fetch the examples
git clone --depth 1 --recursive https://github.com/philfry/ansiblemitogentest.git /var/tmp/mitogentest
# install the dummy collection
ansible-galaxy collection install -r /var/tmp/mitogentest/requirements.yml
Then run the example playbooks.
-
play-example01.yml
uses thelinear
stragegy (thus not using mitogen) and simplified module names. This works:
TASK [debug] *************************************************************************************
ok: [localhost] => {
"msg": "using simplified module name, not using mitogen"
}
TASK [dummy : print hello world] *****************************************************************
[WARNING]: this is a warning
changed: [localhost] => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": true, "msg": "Hello world"}
-
play-example02.yml
usesmitogen_linear
and FQCN. This works, too:
TASK [debug] *************************************************************************************
ok: [localhost] => {
"msg": "using fqcn, using mitogen"
}
TASK [dummy_noshort : print hello world] *********************************************************
[WARNING]: this is a warning
changed: [localhost] => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": true, "msg": "Hello world"}
-
play-example03.yml
usesmitogen_linear
and simplified module names. This breaks:
TASK [debug] *************************************************************************************
ok: [localhost] => {
"msg": "using simplified module name, using mitogen"
}
TASK [dummy : print hello world] *****************************************************************
fatal: [localhost]: FAILED! => {"msg": "The module hello was not found in configured module paths"}
Attached: ANSIBLE_DEBUG=1 ansible-playbook play-example03.yml -vvvvv
play-example03.txt
fwiw, also affects ansible 2.9.18 with mitogen 0.2.9.
Just ran into this myself with ansible 2.9.18 and mitogen 0.2.10rc1.
Any plans to try to address this soon?
Unfortunately this remains a big issue with using mitogen with ansible collections.