On Fri, Jul 22, 2022 at 2:35 PM Michael DiDomenico
<[email protected]> wrote:
>
> sorry for the cross post, i sent this to the devel list by mistake
> ---
> i have compiled a separate version of openssl 1.1.1, python 3.10.5,
> and ansible 2.13.2 into my home directory.  i have the
> interpreter_python set in the ansible.cfg file to point to the version
> of python in my home directory.


> i'm new to ansible and python, so i'm not sure where the error lies.


May I suggest you stop right there?

First, you're using ansible-core 2.13.2. ansible-core is everything
that really matters, including the primary ansible tools and modules.
The "ansible" package is quite useless for most, a bundle of more than
100 ansible galaxy collection modules. Yes, it's confusing, I've
argued before that "ansible-core" should have been left named
"ansible" as it was back with ansible 2.9, and the ansible collection
should match the name of the directories it actually insalls, namely
"ansible_collections". But good luck trying to get *that* revised.

So, if you're new to python, why are you trying to hurt yourself by
building your own python and openssl? We can't even deduce where you
put them and how you reference them. You're in the position of someone
new to electronics who decided to make their own battery. One of the
advantages of the open source and free software world is you can start
from already working tools, and focus on the bits vital to your
project. So why are you starting with openssl and python? Ansible is
designed, when talking to remte hosts, to do a lot of deduction about
the remote python and use the built-in python there. Based on your
error messages, that's a RHEL environment with "/usr/bin/python" being
linked to python 2.7.

If you need to build your own updated ansible-core, may I strongly
urge you to work from the RHEL published ansible packages, or if you
need a more recent ansible-core RPM, take a look at my RPM building
tools over at https:/github.com/n kadel/ansiblerepo/ ? It's quite
tricky to update ansible-core past version 2.11 on RHEL 7, you need to
use steps like "pip3 install -user ansible-core"

> i'm hedging a bet, it's in the way i compiled python in my home
> directory.  it happened when i pip installed ansible with my custom
> python.  but i'm not sure which or how exactly to debug this
> dependency issue
>
> TASK [install ntpd if missing]
> **********************************************************************************************************************************************************************************
> task path: /home1/user/ansible_ccm/playbooks/ntpd/main.yml:15
> Friday 22 July 2022  11:10:46 -0700 (0:00:01.705)       0:00:01.731 
> ***********
> Friday 22 July 2022  11:10:46 -0700 (0:00:01.706)       0:00:01.730 
> ***********
> Running ansible.legacy.yum
> Using module file
> /u/user/ansible/lib/python3.10/site-packages/ansible/modules/yum.py
> Pipelining is enabled.
> <host1> ESTABLISH LOCAL CONNECTION FOR USER: root
> <host1> EXEC /bin/sh -c
> 'PYTHONPATH=/u/user/ansible/lib/python3.10/site-packages/:/u/mdidome1/ansible/lib64/python3.10/site-packages/
> LD_LIBRARY_PATH=/u/user/ansible/lib:/u/user/ansible/lib64
> /u/user/ansible/bin/python3.10 && sleep 0'
> The full traceback is:
> Traceback (most recent call last):
>   File "<stdin>", line 16, in <module>
>   File "/usr/lib64/python2.7/runpy.py", line 176, in run_module
>     fname, loader, pkg_name)
>   File "/usr/lib64/python2.7/runpy.py", line 82, in _run_module_code
>     mod_name, mod_fname, mod_loader, pkg_name)
>   File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
>     exec code in run_globals
>   File 
> "/tmp/ansible_ansible.legacy.yum_payload_aa9h7s_4/ansible_ansible.legacy.yum_payload.zip/ansible/modules/yum.py",
> line 405, in <module>
>   File 
> "/tmp/ansible_ansible.legacy.yum_payload_aa9h7s_4/ansible_ansible.legacy.yum_payload.zip/ansible/module_utils/urls.py",
> line 116, in <module>
>   File "/usr/lib/python2.7/site-packages/urllib3/contrib/pyopenssl.py",
> line 46, in <module>
>     import OpenSSL.SSL
>   File "/usr/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8,
> in <module>
>     from OpenSSL import rand, crypto, SSL
>   File "/usr/lib/python2.7/site-packages/OpenSSL/rand.py", line 12, in 
> <module>
>     from OpenSSL._util import (
>   File "/usr/lib/python2.7/site-packages/OpenSSL/_util.py", line 6, in 
> <module>
>     from cryptography.hazmat.bindings.openssl.binding import Binding
>   File 
> "/u/user/ansible/lib/python3.10/site-packages/cryptography/__init__.py",
> line 13, in <module>
>     from cryptography.utils import CryptographyDeprecationWarning
>   File "/u/user/ansible/lib/python3.10/site-packages/cryptography/utils.py",
> line 30
>     def _check_bytes(name: str, value: bytes) -> None:
>                          ^
> SyntaxError: invalid syntax
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/CABOsP2MtVxdtZrwLHFuT8Unpb7zrBsekR22Y9ED78mj3VyJwVg%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAOCN9rz5B5LSCRCtwwsN2uNdLw8A-RrsU%3D8hdSGFYiRmLVW0tA%40mail.gmail.com.

Reply via email to