On 4/13/23 09:26, Marcel Telka wrote:
On Thu, Apr 13, 2023 at 09:13:03AM +0200, Predrag Zečević via 
openindiana-discuss wrote:

On 4/13/23 08:12, Andreas Wacknitz wrote:
Am 13.04.23 um 07:47 schrieb Predrag Zečević via openindiana-discuss:
After latest OI update:

:; ansible --version
ERROR: Ansible requires Jinja2 3.0 or newer on the controller. Current
version: 2.11.3

:; ls -la $(which ansible)
lrwxrwxrwx 1 root root 11 Apr 12 23:10 /usr/bin/ansible -> ansible-3.9

:; pkg list | grep -Ei "jinja|ansible"
library/python/ansible 7.4.0-2023.0.0.0           i--
library/python/ansible-core 2.14.4-2023.0.0.0          i--
library/python/ansible-core-37 2.14.4-2023.0.0.0          i--
library/python/ansible-core-39 2.14.4-2023.0.0.0          i--
library/python/jinja2 3.1.2-2023.0.0.0           i--
library/python/jinja2-37 3.1.2-2023.0.0.0           i--
library/python/jinja2-39 3.1.2-2023.0.0.0           i--
system/management/ansible 7.4.0-2023.0.0.0           i--

Something is wrong, as my system provides Jinja2, version 3.1.2

Any hints?
Best regards

On my side everything is as expected, please create a new account an try
to use ansible with that. Maybe you have a broken configuration on your
account.

Andreas

Hi Andreas,
thanks for hint, but it shows also same problem for new user account as
well.

I tried to truss ansible command, and then:
:; grep -i jinja /tmp/ansible.truss
9937:
open("/usr/lib/python3.9/site-packages/Jinja2-2.11.3.dist-info/METADATA",
O_RDONLY|O_CLOEXEC) = 3

Indeed:
:; ls -hlad /usr/lib/python3.9/site-packages/{j,J}inja*
drwxr-xr-x 3 root root 30 Feb  5  2021
/usr/lib/python3.9/site-packages/jinja2
drwxr-xr-x 2 root root  9 Feb  5  2021
/usr/lib/python3.9/site-packages/Jinja2-2.11.3.dist-info

:; pkg search -l
/usr/lib/python3.9/site-packages/Jinja2-2.11.3.dist-info/METADATA
[NO RESULT]

There is also (not under site-packages, but vendor-packages):
/usr/lib/python3.9/vendor-packages/Jinja2-3.1.2-py3.9.egg-info/PKG-INFO

If I do this:
:; pfexec mv /usr/lib/python3.9/site-packages/Jinja2-2.11.3.dist-info
/var/tmp

then it still shows wrong jinja2 version:
:; ansible --version
ansible [core 2.14.4]
   config file = None
   configured module search path =
['/export/home/predrag_zecevic/.ansible/plugins/modules',
'/usr/share/ansible/plugins/modules']
   ansible python module location =
/usr/lib/python3.9/vendor-packages/ansible
   ansible collection location = 
/export/home/predrag_zecevic/.ansible/collections:/usr/share/ansible/collections
   executable location = /usr/bin/ansible
   python version = 3.9.16 (main, Feb 19 2023, 15:42:40) [GCC 10.4.0]
(/usr/bin/python3.9)
   jinja version = 2.11.3
   libyaml = True

Seems that (due to many updates) I have some orphaned Jinja2 2.11.3
settings. I am bit lost now.

The problem is that you installed Jinja2 via pip.  This is not
recommended and should be avoided.  Packages installed via pip takes
precedence over system packages.  You should uninstall Jinja2 2.11.3
using pip.

In other words, your /usr/lib/python3.9/site-packages should contain
only files known to pkg.  In ideal world the
/usr/lib/python3.9/site-packages directory should be (almost) empty, but
it is currently not (yet).  If you need some Python package not provided
by OI pkg repo, please let me know and I'll try to package it.

Please also make sure that 'pip3.9 list --user' output is empty.

In short, running 'pip install' is unsupported and discouraged.


HTH.

Thanks, it has helped!

:; pfexec pip3.9 uninstall Jinja2
Found existing installation: Jinja2 2.11.3 Uninstalling Jinja2-2.11.3:

  Would remove:
/usr/lib/python3.9/site-packages/Jinja2-2.11.3.dist-info/*
    /usr/lib/python3.9/site-packages/jinja2/*
Proceed (Y/n)? Y
  Successfully uninstalled Jinja2-2.11.3

:; ansible --version
ansible [core 2.14.4]
  config file = None
configured module search path = ['/export/home/predrag_zecevic/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.9/vendor-packages/ansible ansible collection location = /export/home/predrag_zecevic/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
python version = 3.9.16 (main, Feb 19 2023, 15:42:40) [GCC 10.4.0] (/usr/bin/python3.9)
  jinja version = 3.1.2
  libyaml = True

:; pip3.9 list --user
[EMPTY]

One more time, thanks a lot Marcel.

Best regards.
--
Predrag Zečević

_______________________________________________
openindiana-discuss mailing list
openindiana-discuss@openindiana.org
https://openindiana.org/mailman/listinfo/openindiana-discuss

Reply via email to