freeipa / ansible-freeipa

Ansible roles and modules for FreeIPA
GNU General Public License v3.0
504 stars 232 forks source link

Problem running role ipaclient on Ubuntu 18.04 (cffi) #222

Closed zenntrix closed 4 years ago

zenntrix commented 4 years ago

Version: 0.1.8-1

When I run the playbook against a Ubuntu 18.04.4 host I recieve an error saying The error was: DistributionNotFound: cffi>=1.8,!=1.11.3.

It fails on section [ipaclient : Install - IPA client test]

Full -vvv

The full traceback is:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 146, in run
    res = self._execute()
  File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 645, in _execute
    result = self._handler.run(task_vars=variables)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/action/normal.py", line 46, in run
    result = merge_hash(result, self._execute_module(task_vars=task_vars, wrap_async=wrap_async))
  File "/usr/lib/python2.7/site-packages/ansible/plugins/action/__init__.py", line 815, in _execute_module
    (module_style, shebang, module_data, module_path) = self._configure_module(module_name=module_name, module_args=module_args, task_vars=task_vars)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/action/__init__.py", line 209, in _configure_module
    **become_kwargs)
  File "/usr/lib/python2.7/site-packages/ansible/executor/module_common.py", line 1258, in modify_module
    environment=environment)
  File "/usr/lib/python2.7/site-packages/ansible/executor/module_common.py", line 1095, in _find_module_utils
    py_module_cache, zf)
  File "/usr/lib/python2.7/site-packages/ansible/executor/module_common.py", line 731, in recursive_finder
    [os.path.join(*py_module_name[:-idx])])
  File "/usr/lib/python2.7/site-packages/ansible/executor/module_common.py", line 650, in __init__
    self.get_source()
  File "/usr/lib/python2.7/site-packages/ansible/executor/module_common.py", line 665, in get_source
    pkg = import_module(self._package_name)
  File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/lib/python2.7/site-packages/ansible/utils/collection_loader.py", line 112, in load_module
    mod = self._find_module(fullname, None, load=True)[1]
  File "/usr/lib/python2.7/site-packages/ansible/utils/collection_loader.py", line 252, in _find_module
    exec(code_object, newmod.__dict__)
  File "/root/.ansible/collections/ansible_collections/freeipa/ansible_freeipa/plugins/module_utils/ansible_ipa_client.py", line 104, in <module>
    from ipaclient.install import ipadiscovery
  File "/usr/lib/python2.7/site-packages/ipaclient/install/ipadiscovery.py", line 29, in <module>
    from ipalib import errors
  File "/usr/lib/python2.7/site-packages/ipalib/__init__.py", line 919, in <module>
    from ipalib import plugable
  File "/usr/lib/python2.7/site-packages/ipalib/plugable.py", line 42, in <module>
    from ipalib.config import Env
  File "/usr/lib/python2.7/site-packages/ipalib/config.py", line 43, in <module>
    from ipaplatform.tasks import tasks
  File "/usr/lib/python2.7/site-packages/ipaplatform/tasks.py", line 10, in <module>
    ipaplatform._importhook.fixup_module('ipaplatform.tasks')
  File "/usr/lib/python2.7/site-packages/ipaplatform/_importhook.py", line 135, in load_module
    platform_mod = importlib.import_module(alias)
  File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/lib/python2.7/site-packages/ipaplatform/rhel/tasks.py", line 26, in <module>
    from ipaplatform.redhat.tasks import RedHatTaskNamespace
  File "/usr/lib/python2.7/site-packages/ipaplatform/redhat/tasks.py", line 49, in <module>
    from ipaplatform.base.tasks import BaseTaskNamespace
  File "/usr/lib/python2.7/site-packages/ipaplatform/base/tasks.py", line 29, in <module>
    from pkg_resources import parse_version
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 3011, in <module>
    parse_requirements(__requires__), Environment()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 626, in resolve
    raise DistributionNotFound(req)
DistributionNotFound: cffi>=1.8,!=1.11.3

fatal: [janus.corp.bitbrainsoftware.com]: FAILED! => {
    "msg": "Unexpected failure during module execution.", 
    "stdout": ""
}
t-woerner commented 4 years ago

The deployment roles are installing the needed IPA packages on the machine as one of the first steps. There seems to be a dependency issue in one of the packages that will be installed or updated.

Please open a bug for Ubuntu about this.

zenntrix commented 4 years ago

Apologies i am not sure i follow, the packages have been installed, it is now trying to run IPA client test when it fails, i am not sure why this is a bug on Ubuntu but maybe you could clarify for me :). I have checked and cffi is installed on the system, version 1.11.5-1 which seems to meet the criteria >=1.8,!=1.11.3

t-woerner commented 4 years ago

O.k. this is not the installation step. The requirement cffi>=1.8,!=1.11.3 is not part of FreeIPA or ansible-freeipa. I really do not know where it is from.

tiran commented 4 years ago

The requirement is coming from cryptography package, https://github.com/pyca/cryptography/blob/master/setup.py#L43

setup_requirements = ["cffi>=1.8,!=1.11.3"]

pkg_resources parses and process all dist-info and egg-info directories in all site-packages on import.

zenntrix commented 4 years ago

So i have been trying a few other things and if i use the same ansible scripts against the same remote machine (Ubuntu 18.04) but using a different ansible host to run the playbook from, it works. Does that help shed any light?

zenntrix commented 4 years ago

Ok, seemed to have fixed this! On the ansible host i uninstalled and re-installed 'cryptography' using pip and that seemed to have solved the problem.

My ansible host is running Centos 7 so this is unrelated to Ubuntu