Ich muss psycopg zu einem alten Python (2.4) installieren. Alles funktioniert gut, außer das Einstellen der Umgebungsvariablen -> LD_LIBRARY_PATH.Ansible playbook, set Umgebungsvariablen nicht funktioniert
- name: install psycopg
shell: "{{ item }}"
environment:
CPPFLAGS: "-I/my_python/lib/python2.4/site-packages/mx/DateTime/mxDateTime"
LD_LIBRARY_PATH: "/path_to_postgresql/lib"
args:
chdir: "/path_to_psycopg_src/"
with_items:
- ./configure --prefix=/my_python --with-python=/my_python/bin/python --with-postgres-libraries=/path_to_postgresql/lib --with-postgres-includes=/path_postgresql/include --with-mxdatetime-includes=/my_python/lib/python2.4/site-packages/mx/DateTime/mxDateTime
- make
- make install
Nach erfolgreicher Installation erhalte ich die folgende Fehlermeldung:
>>> import psycopg
ImportError: libpq.so.4: cannot open shared object file: No such file or directory
Wenn ich es manuell zu exportieren, es funktioniert gut:
export LD_LIBRARY_PATH="/path_postgresql/lib"
>>> import psycopg
>>> psycopg
<module 'psycopg' from '/my_python/lib/python2.4/site-packages/psycopgmodule.so'>
bearbeiten müssen So ist es in einem ansible playbook nicht möglich? – saromba
Sie können/etc/environment in Ihrem ansible playbook bearbeiten – Abdulafaja
Mein Problem ist, dass ich keine Rechte habe, um/etc/environment zu bearbeiten – saromba