for anyone that might come across this in the future, it looks like
this might boil down to a dependecy hell problem

python3 and ansible2.13 require 37.0.4 which is not compatible with python2.7

the yum utils require python2 in order to run, which are not
compatible with cryptography or python3.  so when you use 'package' in
an ansible playbook, it spawns /usr/bin/python (which is 2.7 in my) to
run the yum utils.

you might think i could switch to ansible.builtin.dnf which is python3
compatible, however, python3-dnf doesn't exist on rhel7, only rhel8

i might not have that all straight, but that's the jist of it



On Fri, Jul 22, 2022 at 2:34 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.
>
> on some hosts my playbook runs okay, but on others i'm getting the
> below error.  what i think the problem is, is that python is finding
> modules in the 2.7 system libs on particular hosts and not others.  on
> the hosts that work i'm guessing python isn't picking up the 2.7
> system lib versions
>
> i'm new to ansible and python, so i'm not sure where the error lies.
> 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/CABOsP2PVjwkKWGUgCBwLtSyVB_Yg56ZEOweCgiR2PXQ07Yprjg%40mail.gmail.com.

Reply via email to