For those who want to run ovirt playbooks/dynamic inventories in a full
Python3 awx/tower environment without any issue, you should consider
this important point (as ovirt playbooks need to run with a local
connection and with specific venv):
"(...) make sure any host with |ansible_connection: local| /also/
specifies |ansible_python_interpreter: '{{ ansible_playbook_python }}'|."
my awx local inventory looks like this:
---
ansible_ssh_user: root
ansible_python_interpreter: '{{ ansible_playbook_python }}'
Without this, awx will run playbook with the local (default OS one)
python binary instead of the venv one that must contain the nss/openssl
re-compiled pycurl.
If you aim to use awx-rpm (
)
* only el7 RPMs with default local py27, so consider the precedent point
* create venv in the default venv path
/opt/rh/rh-python36/root/usr/bin/awx-create-venv -n py36
* compile pycurl with nss support :
yum install -y make gcc redhat-rpm-config python3-devel
libcurl-devel libxml2-devel openssl-devel
exportPYCURL_SSL_LIBRARY=nss;pip install pycurl --compile --no-cache-dir
* Install ovirtsdk4 dependencies:
pip install ansible ovirt-engine-sdk-python psutil
* venv become available into templates/inventory table
If you aim to use regular awx with el8 containers
(
) :
* local python is already 3.6, so no issue with before
* before launching installer:
sed -i
'/project_data_dir/c\project_data_dir=/var/lib/awx/projects'installer/inventory
sed -i
'/custom_venv_dir/c\custom_venv_dir=/opt/my-envs'installer/inventory
* create a venv into the awx_container
docker exec-it awx_web bash
yum install -y make gcc redhat-rpm-config python3-devel
libcurl-devel libxml2-devel openssl-devel
python3 -m venv /opt/my-envs/py36
* compile pycurl with openssl support :
source/opt/my-envs/py36/bin/activate
exportPYCURL_SSL_LIBRARY=openssl;pip install pycurl --compile
--no-cache-dir
* Install ovirtsdk4 dependencies:
pip install ansible ovirt-engine-sdk-python psutil
* So as to get venv droplist availaible into templates/inventory tab
settings -> system -> custom environment paths -> /opt/my-envs and
login/logout.
Le 03/12/2019 à 04:07, Guillaume Pavese a écrit :
My problem was that I did not fully follow your directions, and had
not pip installed ovirt-engine-sdk-python in the virtualenv.
Inventory is syncing now in awx.
Thanks for the help!
Guillaume Pavese
IngénieurSystèmeet Réseau
Interactiv-Group
On Fri, Nov 29, 2019 at 8:07 PM Nathanaël Blanchet <blanchet(a)abes.fr
<mailto:blanchet@abes.fr>> wrote:
try if you can get a result with plain ovirt4.py execution:
cd /tmp
rsync -av
/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/awx/plugins/inventory/ovirt4.py
.
cat ovirt.ini
[ovirt]
ovirt_url =
https://engine_fqdn/ovirt-engine/api
ovirt_username = admin@internal
ovirt_password = passwd
./ovirt4.py
Le 29/11/2019 à 09:57, Guillaume Pavese a écrit :
> Hi,
>
> I use awx rpm from awx.wiki and followed your directions to
> create a python2 venv with ansible 2.9.1 and built pycurl with
> nss, however syncing the inventory still fails :
>
> stderr:
> ansible-inventory 2.9.1
> config file = None
> configured module search path =
> [u'/var/lib/awx/.ansible/plugins/modules',
> u'/usr/share/ansible/plugins/modules']
> ansible python module location =
> /var/lib/awx/venv/ovirt-p2/lib/python2.7/site-packages/ansible
> executable location =
> /var/lib/awx/venv/ovirt-p2/bin/ansible-inventory
> python version = 2.7.5 (default, Aug 7 2019, 00:51:29) [GCC
> 4.8.5 20150623 (Red Hat 4.8.5-39)]
> No config file found; using defaults
> setting up inventory plugins
> [WARNING]: * Failed to parse
> /opt/rh/rh-python36/root/usr/lib/python3.6/site-
> packages/awx/plugins/inventory/ovirt4.py with script plugin:
> Inventory script
> (/opt/rh/rh-python36/root/usr/lib/python3.6/site-
> packages/awx/plugins/inventory/ovirt4.py) had an execution error:
>
> File
>
"/var/lib/awx/venv/ovirt-p2/lib/python2.7/site-packages/ansible/inventory/manager.py",
> line 280, in parse_source
> plugin.parse(self._inventory, self._loader, source, cache=cache)
> File
>
"/var/lib/awx/venv/ovirt-p2/lib/python2.7/site-packages/ansible/plugins/inventory/script.py",
> line 161, in parse
> raise AnsibleParserError(to_native(e))
>
> [WARNING]: Unable to parse
> /opt/rh/rh-python36/root/usr/lib/python3.6/site-
> packages/awx/plugins/inventory/ovirt4.py as an inventory source
>
> Guillaume Pavese
> IngénieurSystèmeet Réseau
> Interactiv-Group
>
>
> On Fri, Nov 29, 2019 at 4:51 AM Nathanaël Blanchet
> <blanchet(a)abes.fr <mailto:blanchet@abes.fr>> wrote:
>
> give a try to
https://awx.wiki/ based on rpms and not docker
> if you want to test this feature, it rocks.
>
> ------------------------------------------------------------------------
> *De: *"Gianluca Cecchi" <gianluca.cecchi(a)gmail.com
> <mailto:gianluca.cecchi@gmail.com>>
> *À: *"Nathanaël Blanchet" <blanchet(a)abes.fr
> <mailto:blanchet@abes.fr>>
> *Cc: *"users" <users(a)ovirt.org
<mailto:users@ovirt.org>>
> *Envoyé: *Jeudi 28 Novembre 2019 19:17:12
> *Objet: *Re: [ovirt-users] AWX and error using ovirt as an
> inventory source
>
> On Thu, Nov 28, 2019 at 5:33 PM Nathanaël Blanchet
> <blanchet(a)abes.fr <mailto:blanchet@abes.fr>> wrote:
>
>
> Le 28/11/2019 à 17:15, Gianluca Cecchi a écrit :
>
> On Thu, Nov 28, 2019 at 4:59 PM Nathanaël Blanchet
> <blanchet(a)abes.fr <mailto:blanchet@abes.fr>> wrote:
>
> Hello gianluca,
>
> I reported this issue a long time ago (march of
> 19) in an unofficial rpm awx project
>
>
https://github.com/MrMEEE/awx-build/issues/72
>
>
> But I see that it is marked as closed....
>
> It's marked as closed for the unofficial RPM project
> only, not with the regular container deployment.
>
> All related RHV/ovirt stuff (not only dynamic
> inventory, but all ovirt* ansible module) fail
> because of the version of pycurl (worked before 7.19)
>
> You mean inside awx container, correct?
> See below my comments, as I know almost nothing about
> venv concepts... sorry
>
> What you need to do is create a py2.x venv then
> recompile latest pycurl with nss support like this:
>
> * #
> /opt/rh/rh-python36/root/usr/bin/awx-create-venv
> (-e /var/lib/awx/venv/) -n ovirt
>
> I have to run this inside awx container as user root?
> Can you explain the syntax? I get error because of
> the parenthesis...
>
> sure inside the container, parenthesis are the default
> parameters so you can use an other path:
>
> /opt/rh/rh-python36/root/usr/bin/awx-create-venv -n ovirt
> -p 2
>
>
> In my awx container I don't
> have /opt/rh/rh-python36/root/usr/bin/awx-create-venv and
> don't have awx-create-venv at all in any path.
> Not in container based on image ansible/awx_task:9.0.1 nor in
> container based on image ansible/awx_web:9.0.1
>
> Gianluca
>
> _______________________________________________
> Users mailing list -- users(a)ovirt.org <mailto:users@ovirt.org>
> To unsubscribe send an email to users-leave(a)ovirt.org
> <mailto:users-leave@ovirt.org>
> Privacy Statement:
https://www.ovirt.org/site/privacy-policy/
> oVirt Code of Conduct:
>
https://www.ovirt.org/community/about/community-guidelines/
> List Archives:
>
https://lists.ovirt.org/archives/list/users@ovirt.org/message/4MSEW7LVC4Q...
>
>
> Ce message et toutes les pièces jointes (ci-après le “message”)
> sont établis à l’intention exclusive de ses destinataires et sont
> confidentiels. Si vous recevez ce message par erreur, merci de le
> détruire et d’en avertir immédiatement l’expéditeur. Toute
> utilisation de ce message non conforme a sa destination, toute
> diffusion ou toute publication, totale ou partielle, est
> interdite, sauf autorisation expresse. L’internet ne permettant
> pas d’assurer l’intégrité de ce message . Interactiv-group (et
> ses filiales) décline(nt) toute responsabilité au titre de ce
> message, dans l’hypothèse ou il aurait été modifié. IT, ES, UK.
> <
https://interactiv-group.com/disclaimer.html>
>
--
Nathanaël Blanchet
Supervision réseau
Pôle Infrastrutures Informatiques
227 avenue Professeur-Jean-Louis-Viala
34193 MONTPELLIER CEDEX 5
Tél. 33 (0)4 67 54 84 55
Fax 33 (0)4 67 54 84 14
blanchet(a)abes.fr <mailto:blanchet@abes.fr>
Ce message et toutes les pièces jointes (ci-après le “message”) sont
établis à l’intention exclusive de ses destinataires et sont
confidentiels. Si vous recevez ce message par erreur, merci de le
détruire et d’en avertir immédiatement l’expéditeur. Toute utilisation
de ce message non conforme a sa destination, toute diffusion ou toute
publication, totale ou partielle, est interdite, sauf autorisation
expresse. L’internet ne permettant pas d’assurer l’intégrité de ce
message . Interactiv-group (et ses filiales) décline(nt) toute
responsabilité au titre de ce message, dans l’hypothèse ou il aurait
été modifié. IT, ES, UK. <
https://interactiv-group.com/disclaimer.html>
--
Nathanaël Blanchet
Supervision réseau
SIRE
227 avenue Professeur-Jean-Louis-Viala
34193 MONTPELLIER CEDEX 5
Tél. 33 (0)4 67 54 84 55
Fax 33 (0)4 67 54 84 14
blanchet(a)abes.fr