Open nhosoi opened 4 years ago
Response from @t-woerner
yes, this is a known Ansible issue: https://github.com/ansible/ansible/issues/68361
ansible-freeipa has been running into this months ago already. Also I have been
talking about this in the system-roles meetings before. This is fixed in
Ansible 2.10 so far. A backport to 2.9 was planned, but I am not sure that it
happened.
The source of this issue is that Ansible is trying to find out which files need
to be transferred from the controller to the node to be able to execute the
task. The new collection code is doing this in a different way an is failing if
there are bindings that can not be imported. The bindings might only exist on
the node and not the controller. Ansible 2.10 has a fix for this, but a
backport to the release that you are using in the test seems to be missing. I
have not tested this lately.
A possible workaround is to install the bindings that are used in the module
utils script also on the controller. Another solution is to move all imports in
the module_utils script into a try except section. But this will require
special error handling in the modules later on.
I tested with the latest version of ansible-2.9 [0], and got the same failure [1]. [0]
$ ansible --version
ansible 2.9.15
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/tester/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.8/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.8.6 (default, Sep 25 2020, 00:00:00) [GCC 10.2.1 20200723 (Red Hat 10.2.1-1)]
[1]
File "/usr/lib64/python3.8/importlib/util.py", line 114, in find_spec
raise ValueError('{}.__spec__ is None'.format(name))
ValueError: ansible_collections.fedora.system_roles.plugins.module_utils.network_lsr.nm.provider.__spec__ is None
Roles affected: certificate, network, storage
Failed test example: https://fedorapeople.org/groups/linuxsystemroles/logs/linux-system-roles-network-pull-linux-system-roles_network-319-a4d19a4-centos-8-20201122-233541/artifacts/ansible.log
The full traceback is:
To reproduce the failure, run-tests needs to be run in docker/podman/openshift. I.e., the tests are successfully run if run-tests is executed locally.
Version info:
The failed backtraces above look quite similar to the ones in these ansible-freeipa issues. https://github.com/freeipa/ansible-freeipa/issues/230 https://github.com/freeipa/ansible-freeipa/issues/144 https://github.com/freeipa/ansible-freeipa/issues/315 There is a discussion in the ansible itself, as well. https://github.com/ansible/ansible/issues/68361 According to this pr207, the problem is fixed in ansible 2.10. https://github.com/freeipa/ansible-freeipa/issues/207
I think we need to find out our workaround for ansible 2.9.
Another unrelated note: ANSIBLE_COLLECTIONS_PATHS is likely deprecated and replaced with ANSIBLE_COLLECTIONS_PATH in ansible 2.10.