[ovirt-users] Re: AWX and error using ovirt as an inventory source

2020-01-09 Thread Gianluca Cecchi
On Tue, Jan 7, 2020 at 4:42 PM Gianluca Cecchi 
wrote:

> On Wed, Dec 18, 2019 at 7:28 PM Nathanaël Blanchet 
> wrote:
>
>> Hello Ondra what do you think about this question?
>> ovirt4.py may need some modifications to get required IPs/hostnames when
>> multiple vm has multiple interfaces ?
>> Personalized hack works for me but I have to modify the file each time I
>> upgrade AWX.
>> --
>>
>>
[snip]

Any feedback on this and why the sync of the inventory from the GUI doesn't
> update the ansible_host variable?
> Nathanaël, can you try, if you have a dev environment, to change the
> ansible_host to another value and see if it is picked up or not?
> In the mean time I see that in my bug entry for awx the status has been
> put to need_info, but I don't know why and I have asked more info about
> it
>
> Gianluca
>

I think I have found the culprit: during source inventory sync it is the
ovirt4.py of awx_task container that is executed and not the ovirt4.py of
awx_web container.
In fact creating a new inventory based on another RHV environment I got the
same problem related to ansible_host variable value.
As soon as I modify instead the
/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/plugins/inventory/ovirt4.py
on awx_task container I both get correct values (vm.fqdn) for new created
inventories and when updating existing ones.

Gianluca
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@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/LRW4BLZPBHUVAXY36HJPYQ3XB66XQ24X/


[ovirt-users] Re: AWX and error using ovirt as an inventory source

2020-01-07 Thread Gianluca Cecchi
On Wed, Dec 18, 2019 at 7:28 PM Nathanaël Blanchet  wrote:

> Hello Ondra what do you think about this question?
> ovirt4.py may need some modifications to get required IPs/hostnames when
> multiple vm has multiple interfaces ?
> Personalized hack works for me but I have to modify the file each time I
> upgrade AWX.
> --
> *De: *"Gianluca Cecchi" 
> *À: *"Nathanaël Blanchet" 
> *Cc: *"users" 
> *Envoyé: *Mercredi 18 Décembre 2019 17:21:40
> *Objet: *Re: [ovirt-users] AWX and error using ovirt as an inventory
> source
>
> On Thu, Nov 28, 2019 at 4:59 PM Nathanaël Blanchet 
> wrote:
>
>> Hello gianluca,
>>
> [snip]
>
>> PS: Something else that may help, try to hack the ovirt4.py with
>> ansible_host if you want to call the hosts into playbook by the hostname
>> and not the first IP:
>>
>> vi
>> /opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/awx/plugins/inventory/ovirt4.py
>> 'affinity_labels': [label.name for label in labels],
>> ## ajout NBT pour obtenir le nom de l'hote a la place de l ip
>> 'ansible_host': vm.name,
>> 'affinity_groups': [
>>
>>
>>
> Hello,
> coming back to this PS of yours.
> in my case vm.name is not always resolvable, so it is not so feasible.
> But also the default configuration of ansible_host seems quite
> unfortunate
> With the default configuration, I see that for VMs with 2 ips, it gets the
> eth1 one, not matching the VM hostname and so the job fails because of
> unreachable host.
> So I'm trying
> substituting 
> /var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/plugins/inventory/ovirt4.py
>
> from
> return {
> 'id': vm.id,
> 'name': vm.name,
> ...
> 'devices': dict(
> (device.name, [ip.address for ip in device.ips]) for device
> in devices if device.ips
> ),
> 'ansible_host': next((device.ips[0].address for device in devices
> if device.ips), None)
> }
>
> to:
> return {
> 'id': vm.id,
> 'name': vm.name,
> ...
> 'devices': dict(
> (device.name, [ip.address for ip in device.ips]) for device
> in devices if device.ips
> ),
> 'ansible_host': vm.fqdn
> }
>
> If I do this with my test tmp file I see that comparing output of command
>
> (py36) bash-4.4# ./ovirt4.py
>
> I have a new value for ansible_host, matching the fqdn of the VM
> But going into awx, the job continues to fail and also if I go to
> inventory -> sources and sync, even if I check all the "update options":
> OVERWRITE
> OVERWRITE VARIABLES
> UPDATE ON LAUNCH
>
> Still the vm contains ansible_host with the old value, matching the second
> interface and not the fqdn...
>
> Any suggestion?
>
> Gianluca
>
>
Any feedback on this and why the sync of the inventory from the GUI doesn't
update the ansible_host variable?
Nathanaël, can you try, if you have a dev environment, to change the
ansible_host to another value and see if it is picked up or not?
In the mean time I see that in my bug entry for awx the status has been put
to need_info, but I don't know why and I have asked more info about it

Gianluca
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@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/63XZYCF4J7WTXMVR34W4C45YQJTVMFX7/


[ovirt-users] Re: AWX and error using ovirt as an inventory source

2019-12-18 Thread Gianluca Cecchi
On Wed, Dec 18, 2019 at 5:21 PM Gianluca Cecchi 
wrote:

> On Thu, Nov 28, 2019 at 4:59 PM Nathanaël Blanchet 
> wrote:
>
>> Hello gianluca,
>>
> [snip]
>
>> PS: Something else that may help, try to hack the ovirt4.py with
>> ansible_host if you want to call the hosts into playbook by the hostname
>> and not the first IP:
>>
>> vi
>> /opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/awx/plugins/inventory/ovirt4.py
>> 'affinity_labels': [label.name for label in labels],
>> ## ajout NBT pour obtenir le nom de l'hote a la place de l ip
>> 'ansible_host': vm.name,
>> 'affinity_groups': [
>>
>>
>>
> Hello,
> coming back to this PS of yours.
> in my case vm.name is not always resolvable, so it is not so feasible.
> But also the default configuration of ansible_host seems quite
> unfortunate
> With the default configuration, I see that for VMs with 2 ips, it gets the
> eth1 one, not matching the VM hostname and so the job fails because of
> unreachable host.
> So I'm trying
> substituting 
> /var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/plugins/inventory/ovirt4.py
>
> from
> return {
> 'id': vm.id,
> 'name': vm.name,
> ...
> 'devices': dict(
> (device.name, [ip.address for ip in device.ips]) for device
> in devices if device.ips
> ),
> 'ansible_host': next((device.ips[0].address for device in devices
> if device.ips), None)
> }
>
> to:
> return {
> 'id': vm.id,
> 'name': vm.name,
> ...
> 'devices': dict(
> (device.name, [ip.address for ip in device.ips]) for device
> in devices if device.ips
> ),
> 'ansible_host': vm.fqdn
> }
>
> If I do this with my test tmp file I see that comparing output of command
>
> (py36) bash-4.4# ./ovirt4.py
>
> I have a new value for ansible_host, matching the fqdn of the VM
> But going into awx, the job continues to fail and also if I go to
> inventory -> sources and sync, even if I check all the "update options":
> OVERWRITE
> OVERWRITE VARIABLES
> UPDATE ON LAUNCH
>
> Still the vm contains ansible_host with the old value, matching the second
> interface and not the fqdn...
>
> Any suggestion?
>
> Gianluca
>

In the mean time I opened an issue in awx:
https://github.com/ansible/awx/issues/5539

Gianluca
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@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/7YBFQISJPWUAXJVIG5CMG7BSYJXB4G3B/


[ovirt-users] Re: AWX and error using ovirt as an inventory source

2019-12-18 Thread Gianluca Cecchi
On Thu, Nov 28, 2019 at 4:59 PM Nathanaël Blanchet  wrote:

> Hello gianluca,
>
[snip]

> PS: Something else that may help, try to hack the ovirt4.py with
> ansible_host if you want to call the hosts into playbook by the hostname
> and not the first IP:
>
> vi
> /opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/awx/plugins/inventory/ovirt4.py
> 'affinity_labels': [label.name for label in labels],
> ## ajout NBT pour obtenir le nom de l'hote a la place de l ip
> 'ansible_host': vm.name,
> 'affinity_groups': [
>
>
>
Hello,
coming back to this PS of yours.
in my case vm.name is not always resolvable, so it is not so feasible.
But also the default configuration of ansible_host seems quite
unfortunate
With the default configuration, I see that for VMs with 2 ips, it gets the
eth1 one, not matching the VM hostname and so the job fails because of
unreachable host.
So I'm trying
substituting 
/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/plugins/inventory/ovirt4.py

from
return {
'id': vm.id,
'name': vm.name,
...
'devices': dict(
(device.name, [ip.address for ip in device.ips]) for device in
devices if device.ips
),
'ansible_host': next((device.ips[0].address for device in devices
if device.ips), None)
}

to:
return {
'id': vm.id,
'name': vm.name,
...
'devices': dict(
(device.name, [ip.address for ip in device.ips]) for device in
devices if device.ips
),
'ansible_host': vm.fqdn
}

If I do this with my test tmp file I see that comparing output of command

(py36) bash-4.4# ./ovirt4.py

I have a new value for ansible_host, matching the fqdn of the VM
But going into awx, the job continues to fail and also if I go to inventory
-> sources and sync, even if I check all the "update options":
OVERWRITE
OVERWRITE VARIABLES
UPDATE ON LAUNCH

Still the vm contains ansible_host with the old value, matching the second
interface and not the fqdn...

Any suggestion?

Gianluca
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@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/USHA7BGPSOOZG7PN3I2S2YMULGWUN6WM/


[ovirt-users] Re: AWX and error using ovirt as an inventory source

2019-12-16 Thread Gianluca Cecchi
On Fri, Dec 13, 2019 at 11:50 PM Nathanaël Blanchet 
wrote:

> Okay I got it!
>

Thanks for your time ;-)


> container version is slightly different from awx-rpm. All happen in
> awx_web container. You must use persistent volume so as to use venv and
> project data over ephemeral container.
> You must use python 3 with ansible 2.9.x
>

OK. I scratched and started form a clean environment

cd installer && vi inventory
> custom_venv_dir=/opt/my-envs
> project_data_dir=/var/lib/awx/projects
>
>
done


> you can run installer
> ansible-playbook -i inventory install.yml
>
>
done


> check mounts
> docker inspect -f "{{ .Mounts }}" awx_web
> [{bind /opt/my-envs /opt/my-envs rw true rprivate} {bind
> /var/lib/awx/projects /var/lib/awx/projects rw true rprivate}]
>
>
confirmed


> Right from now, you modify the container itself, becareful data are not
> persistent along container lifecycle, so what follows is for POC. You
> should build your own container image with this wanted parameters.
>

ok, this will be next step of configuration phase, after verifying all is
ok. Suggestions?


> yum install -y make gcc redhat-rpm-config python3-devel libcurl-devel
> libxml2-devel
>

This command above puts in these packages:

Installing:
 gccx86_64 8.2.1-3.5.el8
 AppStream  23 M
 libxml2-devel  x86_64 2.9.7-5.el8
 AppStream 1.0 M
 python36-devel x86_64 3.6.8-2.module_el8.0.0+33+0a10c0e1
AppStream  16 k
 redhat-rpm-config  noarch 116-1.el8.0.1
 AppStream  82 k
 libcurl-devel  x86_64 7.61.1-8.el8
BaseOS820 k
Installing dependencies:
 annobinx86_64 8.64-1.el8
AppStream 187 k
 cmake-filesystem   x86_64 3.11.4-3.el8
AppStream  40 k
 cppx86_64 8.2.1-3.5.el8
 AppStream  10 M
 dwzx86_64 0.12-9.el8
AppStream 109 k
 efi-srpm-macrosnoarch 3-2.el8
 AppStream  22 k
 ghc-srpm-macrosnoarch 1.4.2-7.el8
 AppStream 9.3 k
 go-srpm-macros noarch 2-16.el8
AppStream  14 k
 islx86_64 0.16.1-6.el8
AppStream 841 k
 libmpc x86_64 1.0.2-9.el8
 AppStream  59 k
 ocaml-srpm-macros  noarch 5-4.el8
 AppStream 9.4 k
 openblas-srpm-macros   noarch 2-2.el8
 AppStream 7.9 k
 perl-srpm-macros   noarch 1-25.el8
AppStream  11 k
 platform-python-devel  x86_64 3.6.8-4.el8_0
 AppStream 242 k
 python-rpm-macros  noarch 3-37.el8
AppStream  14 k
 python-srpm-macros noarch 3-37.el8
AppStream  14 k
 python3-rpm-generators noarch 5-4.el8
 AppStream  24 k
 python3-rpm-macros noarch 3-37.el8
AppStream  13 k
 qt5-srpm-macrosnoarch 5.11.1-2.el8
AppStream  11 k
 rust-srpm-macros   noarch 5-2.el8
 AppStream 9.2 k
 file   x86_64 5.33-8.el8
BaseOS 76 k
 glibc-develx86_64 2.28-42.el8.1
 BaseOS1.0 M
 glibc-headers  x86_64 2.28-42.el8.1
 BaseOS465 k
 kernel-headers x86_64 4.18.0-80.11.2.el8_0
BaseOS1.6 M
 libgompx86_64 8.2.1-3.5.el8
 BaseOS189 k
 libxcrypt-develx86_64 4.1.1-4.el8
 BaseOS 25 k
 xz-devel   x86_64 5.2.4-3.el8
 BaseOS 62 k
 zipx86_64 3.0-23.el8
BaseOS270 k
 zlib-devel x86_64 1.2.11-10.el8
 BaseOS 56 k


> source /opt/my-envs/py36/bin/activate
>

before this step I have to create the virtualenv, so I executed:

bash-4.4# virtualenv /opt/my-envs/py36
Using base prefix '/usr'
  No LICENSE.txt / LICENSE found in source
New python executable in /opt/my-envs/py36/bin/python3.6
Also creating executable in /opt/my-envs/py36/bin/python
Installing setuptools, pip, wheel...
done.
bash-4.4#

and then:
bash-4.4# source /opt/my-envs/py36/bin/activate
(py36) bash-4.4#

pip install psutil
>

ok. Got:
Successfully installed psutil-5.6.7

export PYCURL_SSL_LIBRARY=openssl; pip install pycurl --compile
> --no-cache-dir
>

This got a problem with missing openssl-devel:

   gcc -pthread -Wno-unused-result -Wsign-compare
-DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
-fexceptions -fstack-protector-strong -grecord-gcc-switches
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYCURL_VERSION="7.43.0.3"
-DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1

[ovirt-users] Re: AWX and error using ovirt as an inventory source

2019-12-13 Thread Nathanaël Blanchet
Okay I got it! 
container version is slightly different from awx-rpm. All happen in awx_web 
container. You must use persistent volume so as to use venv and project data 
over ephemeral container. 
You must use python 3 with ansible 2.9.x 
cd installer && vi inventory 
custom_venv_dir = /opt/my-envs 
project_data_dir = /var/lib/awx/projects 

you can run installer 
ansible-playbook -i inventory install.yml 

check mounts 
docker inspect -f "{{ .Mounts }}" awx_web 
[{bind /opt/my-envs /opt/my-envs rw true rprivate} {bind /var/lib/awx/projects 
/var/lib/awx/projects rw true rprivate}] 

Right from now, you modify the container itself, becareful data are not 
persistent along container lifecycle, so what follows is for POC. You should 
build your own container image with this wanted parameters. 
yum install -y make gcc redhat-rpm-config python3-devel libcurl-devel 
libxml2-devel 
source /opt/my-envs/py36/bin/activate 
pip install psutil 
export PYCURL_SSL_LIBRARY = openssl ; pip install pycurl --compile 
--no-cache-dir 
pip install ansible ovirt-engine-sdk-python centreonapi dnspython 

select the py36 venv into the source to sync and it should work 

De: "Gianluca Cecchi"  
À: "Guillaume Pavese"  
Cc: "Nathanaël Blanchet" , "users"  
Envoyé: Vendredi 6 Décembre 2019 13:40:45 
Objet: Re: [ovirt-users] Re: AWX and error using ovirt as an inventory source 

Actually it seems I was using the wrong container... so explaining why I got 
the not found error about /opt/my-envs/ovirt/lib ... ;-) 

I was working on ansible/awx_web:9.0.1 container, while it seems I have to work 
ansible/awx_task:9.0.1 

After doing same steps on this container I get now this kind of error at the 
end while using apparently the correct virtualenv: 

2.429 INFO Updating inventory 4: MYDC_OVIRT 
3.257 DEBUG Using base command: python /opt/my-envs/ovirt/bin/ansible-inventory 
-i 
/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/plugins/inventory/ovirt4.py
 --playbook-dir 
/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/plugins/inventory 
-v 
3.257 INFO Reading Ansible inventory source: 
/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/plugins/inventory/ovirt4.py
 
3.259 INFO Using VIRTUAL_ENV: /opt/my-envs/ovirt/ 
3.260 INFO Using PATH: 
/opt/my-envs/ovirt/bin:/var/lib/awx/venv/awx/bin:/var/lib/awx/venv/awx/bin:/var/lib/awx/venv/awx/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
 
3.260 INFO Using PYTHONPATH: /opt/my-envs/ovirt/lib/python2.7/site-packages: 
Traceback (most recent call last): 
File "/var/lib/awx/venv/awx/bin/awx-manage", line 11, in  
load_entry_point('awx==9.0.1.0', 'console_scripts', 'awx-manage')() 
File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/__init__.py", 
line 158, in manage 
execute_from_command_line(sys.argv) 
File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/__init__.py",
 line 381, in execute_from_command_line 
utility.execute() 
File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/__init__.py",
 line 375, in execute 
self.fetch_command(subcommand).run_from_argv(self.argv) 
File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py",
 line 323, in run_from_argv 
self.execute(*args, **cmd_options) 
File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py",
 line 364, in execute 
output = self.handle(*args, **options) 
File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/inventory_import.py",
 line 1153, in handle 
raise exc 
File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/inventory_import.py",
 line 1043, in handle 
venv_path=venv_path, verbosity=self.verbosity).load() 
File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/inventory_import.py",
 line 214, in load 
return self.command_to_json(base_args + ['--list']) 
File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/inventory_import.py",
 line 197, in command_to_json 
self.method, proc.returncode, stdout, stderr)) 
RuntimeError: ansible-inventory failed (rc=1) with stdout: 
stderr: 
ansible-inventory 2.9.2 
config file = /etc/ansible/ansible.cfg 
configured module search path = [u'/var/lib/awx/.ansible/plugins/modules', 
u'/usr/share/ansible/plugins/modules'] 
ansible python module location = 
/opt/my-envs/ovirt/lib/python2.7/site-packages/ansible 
executable location = /opt/my-envs/ovirt/bin/ansible-inventory 
python version = 2.7.15 (default, Oct 8 2019, 21:08:29) [GCC 8.2.1 20180905 
(Red Hat 8.2.1-3)] 
Using /etc/ansible/ansible.cfg as config file 
setting up inventory plugins 
[WARNING]: * Failed to parse /var/lib/awx/venv/awx/lib64/python3.6/site- 
packages/awx/plugins/inve

[ovirt-users] Re: AWX and error using ovirt as an inventory source

2019-12-06 Thread Gianluca Cecchi
Actually it seems I was using the wrong container... so explaining why I
got the not found error about /opt/my-envs/ovirt/lib ... ;-)

I was working on ansible/awx_web:9.0.1 container, while it seems I have to
work ansible/awx_task:9.0.1

After doing same steps on this container I get now this kind of error at
the end while using apparently the correct virtualenv:

2.429 INFO Updating inventory 4: MYDC_OVIRT
3.257 DEBUGUsing base command: python
/opt/my-envs/ovirt/bin/ansible-inventory -i
/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/plugins/inventory/ovirt4.py
--playbook-dir
/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/plugins/inventory
-v
3.257 INFO Reading Ansible inventory source:
/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/plugins/inventory/ovirt4.py
3.259 INFO Using VIRTUAL_ENV: /opt/my-envs/ovirt/
3.260 INFO Using PATH:
/opt/my-envs/ovirt/bin:/var/lib/awx/venv/awx/bin:/var/lib/awx/venv/awx/bin:/var/lib/awx/venv/awx/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
3.260 INFO Using PYTHONPATH:
/opt/my-envs/ovirt/lib/python2.7/site-packages:
Traceback (most recent call last):
  File "/var/lib/awx/venv/awx/bin/awx-manage", line 11, in 
load_entry_point('awx==9.0.1.0', 'console_scripts', 'awx-manage')()
  File
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/__init__.py", line
158, in manage
execute_from_command_line(sys.argv)
  File
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/__init__.py",
line 381, in execute_from_command_line
utility.execute()
  File
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/__init__.py",
line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py",
line 323, in run_from_argv
self.execute(*args, **cmd_options)
  File
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py",
line 364, in execute
output = self.handle(*args, **options)
  File
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/inventory_import.py",
line 1153, in handle
raise exc
  File
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/inventory_import.py",
line 1043, in handle
venv_path=venv_path, verbosity=self.verbosity).load()
  File
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/inventory_import.py",
line 214, in load
return self.command_to_json(base_args + ['--list'])
  File
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/inventory_import.py",
line 197, in command_to_json
self.method, proc.returncode, stdout, stderr))
RuntimeError: ansible-inventory failed (rc=1) with stdout:
stderr:
ansible-inventory 2.9.2
  config file = /etc/ansible/ansible.cfg
  configured module search path =
[u'/var/lib/awx/.ansible/plugins/modules',
u'/usr/share/ansible/plugins/modules']
  ansible python module location =
/opt/my-envs/ovirt/lib/python2.7/site-packages/ansible
  executable location = /opt/my-envs/ovirt/bin/ansible-inventory
  python version = 2.7.15 (default, Oct  8 2019, 21:08:29) [GCC 8.2.1
20180905 (Red Hat 8.2.1-3)]
Using /etc/ansible/ansible.cfg as config file
setting up inventory plugins
[WARNING]:  * Failed to parse /var/lib/awx/venv/awx/lib64/python3.6/site-
packages/awx/plugins/inventory/ovirt4.py with script plugin: Inventory
script
(/var/lib/awx/venv/awx/lib64/python3.6/site-
packages/awx/plugins/inventory/ovirt4.py) had an execution error:

  File
"/opt/my-envs/ovirt/lib/python2.7/site-packages/ansible/inventory/manager.py",
line 280, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
  File
"/opt/my-envs/ovirt/lib/python2.7/site-packages/ansible/plugins/inventory/script.py",
line 161, in parse
raise AnsibleParserError(to_native(e))

[WARNING]: Unable to parse /var/lib/awx/venv/awx/lib64/python3.6/site-
packages/awx/plugins/inventory/ovirt4.py as an inventory source

ERROR! No inventory was parsed, please check your configuration and options.

Ideas?
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@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/CX533PLWARW66OVR4HRUU5CI7ISH7WEI/


[ovirt-users] Re: AWX and error using ovirt as an inventory source

2019-12-06 Thread Gianluca Cecchi
On Wed, Dec 4, 2019 at 10:40 AM Guillaume Pavese <
guillaume.pav...@interactiv-group.com> wrote:

> Could it be a rights problem, ie your awx user can not access
> to /opt/my-envs?
> You could try to create the ovirt virtualenv in the default path :
> /var/lib/awx/venv/
>
> I don't know but it doesn't seems so.
If I get the  /api/v2/settings/system/ page I see

"CUSTOM_VENV_PATHS": [
"/opt/my-envs"
],

so it seems it is there.
I'm doing some further pre-tests base on what Nathanaël suggested in a
reply before:

bash-4.4# source /opt/my-envs/ovirt/bin/activate
(ovirt) bash-4.4# python -V
Python 2.7.15
(ovirt) bash-4.4#
(ovirt) bash-4.4# cd /tmp
(ovirt) bash-4.4# rsync -ac
/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/plugins/inventory/ovirt4.py
.
(ovirt) bash-4.4#
setup ovirt.ini file
(ovirt) bash-4.4# ./ovirt4.py
oVirt inventory script requires ovirt-engine-sdk-python >= 4.0.0
(ovirt) bash-4.4#
why?

I do have this:
/opt/my-envs/ovirt/lib/python2.7/site-packages/ovirtsdk4

(ovirt) bash-4.4# ll
/opt/my-envs/ovirt/lib/python2.7/site-packages/ovirtsdk4
total 5864
-rw-r--r-- 1 root root1711 Nov 30 11:23 http.py
-rw-r--r-- 1 root root1718 Nov 30 11:23 http.pyc
-rw-r--r-- 1 root root   35322 Nov 30 11:23 __init__.py
-rw-r--r-- 1 root root   32118 Nov 30 11:23 __init__.pyc
-rw-r--r-- 1 root root   10627 Nov 30 11:23 reader.py
-rw-r--r-- 1 root root   11038 Nov 30 11:23 reader.pyc
-rw-r--r-- 1 root root  591736 Nov 30 11:23 readers.py
-rw-r--r-- 1 root root  420862 Nov 30 11:23 readers.pyc
-rw-r--r-- 1 root root   11080 Nov 30 11:23 service.py
-rw-r--r-- 1 root root   10836 Nov 30 11:23 service.pyc
-rw-r--r-- 1 root root 1243244 Nov 30 11:23 services.py
-rw-r--r-- 1 root root 1200541 Nov 30 11:23 services.pyc
-rw-r--r-- 1 root root  594910 Nov 30 11:23 types.py
-rw-r--r-- 1 root root  851939 Nov 30 11:23 types.pyc
-rw-r--r-- 1 root root 827 Nov 30 11:23 version.py
-rw-r--r-- 1 root root 233 Nov 30 11:23 version.pyc
-rw-r--r-- 1 root root6661 Nov 30 11:23 writer.py
-rw-r--r-- 1 root root6219 Nov 30 11:23 writer.pyc
-rw-r--r-- 1 root root  433610 Nov 30 11:23 writers.py
-rw-r--r-- 1 root root  387104 Nov 30 11:23 writers.pyc
-rwxr-xr-x 1 root root  113096 Nov 30 11:23 xml.so
(ovirt) bash-4.4#

Another test:
(ovirt) bash-4.4# python
Python 2.7.15 (default, Oct  8 2019, 21:08:29)
[GCC 8.2.1 20180905 (Red Hat 8.2.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ovirtsdk4
Traceback (most recent call last):
  File "", line 1, in 
  File
"/opt/my-envs/ovirt/lib/python2.7/site-packages/ovirtsdk4/__init__.py",
line 22, in 
import pycurl
ImportError: pycurl: libcurl link-time ssl backend (openssl) is different
from compile-time ssl backend (nss)
>>> quit()
(ovirt) bash-4.4#

What about mismatch link-time ssl backend and compile-time ssl backend?
It seems that curl is with ssl and not nss:

(ovirt) bash-4.4# curl-config --configure
 '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu'
'--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr'
'--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin'
'--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include'
'--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var'
'--sharedstatedir=/var/lib' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--cache-file=../config.cache'
'--disable-static' '--enable-symbol-hiding' '--enable-ipv6'
'--enable-threaded-resolver' '--with-gssapi' '--with-nghttp2' '--with-ssl'
'--with-ca-bundle=/etc/pki/tls/certs/ca-bundle.crt' '--enable-ldap'
'--enable-ldaps' '--enable-manual' '--with-brotli' '--with-libidn2'
'--with-libmetalink' '--with-libpsl' '--with-libssh'
'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu'
'CFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
'LDFLAGS=-Wl,-z,relro  -Wl,-z,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld'
(ovirt) bash-4.4#

(ovirt) bash-4.4# ldd /usr/bin/curl
linux-vdso.so.1 (0x7ffd420e6000)
libcurl.so.4 => /lib64/libcurl.so.4 (0x7ff6a6c11000)
libmetalink.so.3 => /lib64/libmetalink.so.3 (0x7ff6a6a0)
libssl.so.1.1 => /lib64/libssl.so.1.1 (0x7ff6a676d000)
libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x7ff6a6295000)
libz.so.1 => /lib64/libz.so.1 (0x7ff6a607e000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x7ff6a5e5e000)
libc.so.6 => /lib64/libc.so.6 (0x7ff6a5a9a000)
libnghttp2.so.14 => /lib64/libnghttp2.so.14 (0x7ff6a5874000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x7ff6a5624000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x7ff6a5334000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 

[ovirt-users] Re: AWX and error using ovirt as an inventory source

2019-12-04 Thread Guillaume Pavese
Could it be a rights problem, ie your awx user can not access
to /opt/my-envs?
You could try to create the ovirt virtualenv in the default path :
/var/lib/awx/venv/

Guillaume Pavese
Ingénieur Système et Réseau
Interactiv-Group


On Wed, Dec 4, 2019 at 5:32 PM Gianluca Cecchi 
wrote:

> On Tue, Dec 3, 2019 at 3:02 PM Nathanaël Blanchet 
> wrote:
>
>> Great, I hope Gianluca will be able to sync with the container version!
>>
>>
> Unfortunately not yet.
> When running with the new virtual env I get:
>
> 2.352 INFO Updating inventory 4: MYDC_OVIRT
> 2.825 INFO Reading Ansible inventory source: /var/lib/awx/venv/awx
> /lib64/python3.6/site-packages/awx/plugins/inventory/ovirt4.py
> Traceback (most recent call last):
>   File "/var/lib/awx/venv/awx/bin/awx-manage", line 11, in 
> load_entry_point('awx==9.0.1.0', 'console_scripts', 'awx-manage')()
> ...
>   File 
> "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/inventory_import.py",
> line 101, in build_env
> for version in os.listdir(venv_libdir):
> FileNotFoundError: [Errno 2] No such file or directory:
> '/opt/my-envs/ovirt/lib'
>
> But I have this:
>
> bash-4.4# ls -l /opt/my-envs/ovirt/
> total 4
> drwxr-xr-x 2 root root 4096 Nov 30 11:20 bin
> drwxr-xr-x 2 root root   23 Nov 30 10:56 include
> drwxr-xr-x 3 root root   23 Nov 30 10:56 lib
> lrwxrwxrwx 1 root root3 Nov 30 10:56 lib64 -> lib
> drwxr-xr-x 3 root root   17 Nov 30 11:07 share
> bash-4.4# ls -l /opt/my-envs/ovirt/lib
> total 4
> drwxr-xr-x 4 root root 4096 Nov 30 10:56 python2.7
> bash-4.4#
>
> What I'm missing in your opinion?
> I don't understand the FileNotFoundError
> Thanks in advance,
> Gianluca
>

-- 


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.  

___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@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/NFGVTUF3I2BT6TCDUI4XENQZADNOCYQN/


[ovirt-users] Re: AWX and error using ovirt as an inventory source

2019-12-04 Thread Gianluca Cecchi
On Tue, Dec 3, 2019 at 3:02 PM Nathanaël Blanchet  wrote:

> Great, I hope Gianluca will be able to sync with the container version!
>
>
Unfortunately not yet.
When running with the new virtual env I get:

2.352 INFO Updating inventory 4: MYDC_OVIRT
2.825 INFO Reading Ansible inventory source: /var/lib/awx/venv/awx
/lib64/python3.6/site-packages/awx/plugins/inventory/ovirt4.py
Traceback (most recent call last):
  File "/var/lib/awx/venv/awx/bin/awx-manage", line 11, in 
load_entry_point('awx==9.0.1.0', 'console_scripts', 'awx-manage')()
...
  File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/inventory_import.py",
line 101, in build_env
for version in os.listdir(venv_libdir):
FileNotFoundError: [Errno 2] No such file or directory:
'/opt/my-envs/ovirt/lib'

But I have this:

bash-4.4# ls -l /opt/my-envs/ovirt/
total 4
drwxr-xr-x 2 root root 4096 Nov 30 11:20 bin
drwxr-xr-x 2 root root   23 Nov 30 10:56 include
drwxr-xr-x 3 root root   23 Nov 30 10:56 lib
lrwxrwxrwx 1 root root3 Nov 30 10:56 lib64 -> lib
drwxr-xr-x 3 root root   17 Nov 30 11:07 share
bash-4.4# ls -l /opt/my-envs/ovirt/lib
total 4
drwxr-xr-x 4 root root 4096 Nov 30 10:56 python2.7
bash-4.4#

What I'm missing in your opinion?
I don't understand the FileNotFoundError
Thanks in advance,
Gianluca
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@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/HXSOCTA2UGTJOMTTJQKQ47TNLNIGMFDU/


[ovirt-users] Re: AWX and error using ovirt as an inventory source

2019-12-03 Thread Nathanaël Blanchet
Great, I hope Gianluca will be able to sync with the container version! 


De: "Guillaume Pavese"  
À: "Nathanaël Blanchet"  
Cc: "Gianluca Cecchi" , "users"  
Envoyé: Mardi 3 Décembre 2019 04:07:53 
Objet: Re: [ovirt-users] Re: AWX and error using ovirt as an inventory source 

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énieur Système et Réseau 
Interactiv-Group 


On Fri, Nov 29, 2019 at 8:07 PM Nathanaël Blanchet < [ mailto:blanc...@abes.fr 
| blanc...@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 | 
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 : 

BQ_BEGIN

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énieur Système et Réseau 
Interactiv-Group 


On Fri, Nov 29, 2019 at 4:51 AM Nathanaël Blanchet < [ mailto:blanc...@abes.fr 
| blanc...@abes.fr ] > wrote: 

BQ_BEGIN

give a try to [ https://awx.wiki/ | https://awx.wiki/ ] based on rpms and not 
docker if you want to test this feature, it rocks. 


De: "Gianluca Cecchi" < [ mailto:gianluca.cec...@gmail.com | 
gianluca.cec...@gmail.com ] > 
À: "Nathanaël Blanchet" < [ mailto:blanc...@abes.fr | blanc...@abes.fr ] > 
Cc: "users" < [ mailto:users@ovirt.org | 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 < [ mailto:blanc...@abes.fr 
| blanc...@abes.fr ] > wrote: 

BQ_BEGIN




Le 28/11/2019 à 17:15, Gianluca Cecchi a écrit : 

BQ_BEGIN

On Thu, Nov 28, 2019 at 4:59 PM Nathanaël Blanchet < [ mailto:blanc...@abes.fr 
| blanc...@abes.fr ] > wrote: 

BQ_BEGIN



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 | 
https://github.com/MrMEEE/awx-build/issues/72 ] 




But I see that it is marked as closed 

BQ_END
It's marked as closed for the unofficial RPM project only, not with the regular 
container deployment. 

BQ_BEGIN


BQ_BEGIN



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) 

BQ_END

You mean inside awx container, correct? 
See below my comments, as I know almost nothing about venv concepts... sorry 

BQ_BEGIN



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 

BQ_END

I have to run this inside awx container as user root? Can you explain the 
syntax? I get error because of the parenthesis... 

BQ_END


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 

BQ_BEGIN



BQ_END


BQ_END

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

[ovirt-users] Re: AWX and error using ovirt as an inventory source

2019-12-02 Thread Guillaume Pavese
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énieur Système et Réseau
Interactiv-Group


On Fri, Nov 29, 2019 at 8:07 PM Nathanaël Blanchet  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énieur Système et Réseau
> Interactiv-Group
>
>
> On Fri, Nov 29, 2019 at 4:51 AM Nathanaël Blanchet 
> 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" 
>> *À: *"Nathanaël Blanchet" 
>> *Cc: *"users" 
>> *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 
>> wrote:
>>
>>>
>>> Le 28/11/2019 à 17:15, Gianluca Cecchi a écrit :
>>>
>>> On Thu, Nov 28, 2019 at 4:59 PM Nathanaël Blanchet 
>>> 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

[ovirt-users] Re: AWX and error using ovirt as an inventory source

2019-11-30 Thread Gianluca Cecchi
On Thu, Nov 28, 2019 at 8:50 PM Nathanaël Blanchet  wrote:

> give a try to https://awx.wiki/ based on rpms and not docker if you want
> to test this feature, it rocks.
>
>
Thanks for the input. Interesting.
I would like to still try a little with containers though.
It seems I'm a bit closer.
I used your inputs and what in documentation:
https://docs.ansible.com/ansible-tower/latest/html/upgrade-migration-guide/virtualenv.html

And these below were my steps. In repo sync I now get an error of type:
"
  File
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/inventory_import.py",
line 101, in build_env
for version in os.listdir(venv_libdir):
FileNotFoundError: [Errno 2] No such file or directory:
'/opt/my-envs/ovirt/lib'
"

possibly I have to add something else to this virtualenv?

My steps inside awx container:

1) create directory structure for new custom virtual envs
bash-4.4# mkdir -p /opt/my-envs
bash-4.4# chmod 0755 /opt/my-envs

2) Configure new custom virtual env path
$ curl -k -X PATCH
'https://my_user:my_pwd@my_awx_domain/api/v2/settings/system/'
-d '{"CUSTOM_VENV_PATHS": ["/opt/my-envs/"]}'  -H
'Content-Type:application/json'

{"ACTIVITY_STREAM_ENABLED":true,"ACTIVITY_STREAM_ENABLED_FOR_INVENTORY_SYNC":false,"ORG_ADMINS_CAN_SEE_ALL_USERS":true,"MANAGE_ORGANIZATION_AUTH":true,"TOWER_URL_BASE":"
https://towerhost
","REMOTE_HOST_HEADERS":["REMOTE_ADDR","REMOTE_HOST"],"PROXY_IP_WHITELIST":[],"LICENSE":{},"REDHAT_USERNAME":"","REDHAT_PASSWORD":"","AUTOMATION_ANALYTICS_URL":"
https://example.com
","INSTALL_UUID":"63ee73ee-6346-4bce-b343-e03095238e35","CUSTOM_VENV_PATHS":["/opt/my-envs"],"INSIGHTS_TRACKING_STATE":false,"BROKER_DURABILITY":true}

3) create ovirt virtual env with python2 type
bash-4.4# virtualenv /opt/my-envs/ovirt -p python2
Running virtualenv with interpreter /usr/bin/python2
Already using interpreter /usr/bin/python2
  No LICENSE.txt / LICENSE found in source
New python executable in /opt/my-envs/ovirt/bin/python2
Also creating executable in /opt/my-envs/ovirt/bin/python
Installing setuptools, pip, wheel...
done.
bash-4.4#

4) install packages in container to be able to pip install psutil
yum install gcc redhat-rpm-config python2-devel

5) pip install psutil
bash-4.4# /opt/my-envs/ovirt/bin/pip install psutil
DEPRECATION: Python 2.7 will reach the end of its life on January 1st,
2020. Please upgrade your Python as Python 2.7 won't be maintained after
that date. A future version of pip will drop support for Python 2.7. More
details about Python 2 support in pip, can be found at
https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting psutil
  Using cached
https://files.pythonhosted.org/packages/73/93/4f8213fbe66fc20cb904f35e6e04e20b47b85bee39845cc66a0bcf5ccdcb/psutil-5.6.7.tar.gz
Building wheels for collected packages: psutil
  Building wheel for psutil (setup.py) ... done
  Created wheel for psutil:
filename=psutil-5.6.7-cp27-cp27mu-linux_x86_64.whl size=274582
sha256=bad7ce395c12db2dce3df34ebaf44de8db3137f73363f70743e413c699f23fbe
  Stored in directory:
/home/awx/.cache/pip/wheels/52/41/b0/bf50409fe2b1d3b79afa3eed71b54b3e30fe5b695db2c7ba2e
Successfully built psutil
Installing collected packages: psutil
Successfully installed psutil-5.6.7
bash-4.4#

6) install libcurl-devel in container as it is needed by the pycurl install
next step (curl-config program)
yum install libcurl-devel

7) pip install pycurl with nss

bash-4.4# source /opt/my-envs/ovirt/bin/activate
(ovirt) bash-4.4# export PYCURL_SSL_LIBRARY=nss; pip install pycurl
--compile --no-cache-dir
DEPRECATION: Python 2.7 will reach the end of its life on January 1st,
2020. Please upgrade your Python as Python 2.7 won't be maintained after
that date. A future version of pip will drop support for Python 2.7. More
details about Python 2 support in pip, can be found at
https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting pycurl
  Downloading
https://files.pythonhosted.org/packages/ac/b3/0f3979633b7890bab6098d84c84467030b807a1e2b31f5d30103af5a71ca/pycurl-7.43.0.3.tar.gz
(215kB)
 || 215kB 359kB/s
Building wheels for collected packages: pycurl
  Building wheel for pycurl (setup.py) ... done
  Created wheel for pycurl:
filename=pycurl-7.43.0.3-cp27-cp27mu-linux_x86_64.whl size=282624
sha256=a0e86e85d3ccb614a5b4df9d228797ec48749b395090207281d5525b2b521cc0
  Stored in directory:
/tmp/pip-ephem-wheel-cache-cidPtO/wheels/89/40/f5/7b4f2285aca871b5173887a6c69127210d92806c0d3a977e51
Successfully built pycurl
Installing collected packages: pycurl
Successfully installed pycurl-7.43.0.3
(ovirt) bash-4.4#

8) pip install ansible and python-memached

(ovirt) bash-4.4# pip install ansible python-memcached
DEPRECATION: Python 2.7 will reach the end of its life on January 1st,
2020. Please upgrade your Python as Python 2.7 won't be maintained after
that date. A future version of pip will drop support for Python 2.7. 

[ovirt-users] Re: AWX and error using ovirt as an inventory source

2019-11-29 Thread Nathanaël Blanchet

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 <mailto:blanc...@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" mailto:gianluca.cec...@gmail.com>>
*À: *"Nathanaël Blanchet" mailto:blanc...@abes.fr>>
*Cc: *"users" 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
mailto:blanc...@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
mailto:blanc...@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@ovirt.org <mailto:users@ovirt.org>
To unsubscribe send an email to users-le...@ovirt.org
<mailto:users-le...@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/4MSEW7LVC4QOTANHO7ZVTBSJ7V2DQP4U/


Ce message et toutes les pièces jointes (ci-aprè

[ovirt-users] Re: AWX and error using ovirt as an inventory source

2019-11-29 Thread Guillaume Pavese
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énieur Système et Réseau
Interactiv-Group


On Fri, Nov 29, 2019 at 4:51 AM Nathanaël Blanchet  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" 
> *À: *"Nathanaël Blanchet" 
> *Cc: *"users" 
> *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 
> wrote:
>
>>
>> Le 28/11/2019 à 17:15, Gianluca Cecchi a écrit :
>>
>> On Thu, Nov 28, 2019 at 4:59 PM Nathanaël Blanchet 
>> 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@ovirt.org
> To unsubscribe send an email to users-le...@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/4MSEW7LVC4QOTANHO7ZVTBSJ7V2DQP4U/
>

-- 


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 aura

[ovirt-users] Re: AWX and error using ovirt as an inventory source

2019-11-28 Thread Nathanaël Blanchet
give a try to [ https://awx.wiki/ | https://awx.wiki/ ] based on rpms and not 
docker if you want to test this feature, it rocks. 


De: "Gianluca Cecchi"  
À: "Nathanaël Blanchet"  
Cc: "users"  
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 < [ mailto:blanc...@abes.fr 
| blanc...@abes.fr ] > wrote: 






Le 28/11/2019 à 17:15, Gianluca Cecchi a écrit : 

BQ_BEGIN

On Thu, Nov 28, 2019 at 4:59 PM Nathanaël Blanchet < [ mailto:blanc...@abes.fr 
| blanc...@abes.fr ] > wrote: 

BQ_BEGIN



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 | 
https://github.com/MrMEEE/awx-build/issues/72 ] 




But I see that it is marked as closed 

BQ_END
It's marked as closed for the unofficial RPM project only, not with the regular 
container deployment. 

BQ_BEGIN


BQ_BEGIN



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) 

BQ_END

You mean inside awx container, correct? 
See below my comments, as I know almost nothing about venv concepts... sorry 

BQ_BEGIN



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 

BQ_END

I have to run this inside awx container as user root? Can you explain the 
syntax? I get error because of the parenthesis... 

BQ_END


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 

BQ_BEGIN



BQ_END


BQ_END

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@ovirt.org
To unsubscribe send an email to users-le...@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/4MSEW7LVC4QOTANHO7ZVTBSJ7V2DQP4U/


[ovirt-users] Re: AWX and error using ovirt as an inventory source

2019-11-28 Thread Gianluca Cecchi
On Thu, Nov 28, 2019 at 5:33 PM Nathanaël Blanchet  wrote:

>
> Le 28/11/2019 à 17:15, Gianluca Cecchi a écrit :
>
> On Thu, Nov 28, 2019 at 4:59 PM Nathanaël Blanchet 
> 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@ovirt.org
To unsubscribe send an email to users-le...@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/A24WM64RL2P4RVTIVK2IFHPNCHAG7G2T/


[ovirt-users] Re: AWX and error using ovirt as an inventory source

2019-11-28 Thread Nathanaël Blanchet


Le 28/11/2019 à 17:15, Gianluca Cecchi a écrit :
On Thu, Nov 28, 2019 at 4:59 PM Nathanaël Blanchet > 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


  * source /var/lib/awx/venv/ovirt/bin/activate

as root correct? and I should source the just created venv, correct?

yes


  * # (ovirt) export PYCURL_SSL_LIBRARY=nss; pip install pycurl
--compile --no-cache-dir

I presume (ovirt) is a sort of prompt of the venv

yes
Will the settings preserved across reboot of the server hosting the 
container?

the setting is inside the container


  * choose this venv instead of the regular in your inventory page
and you'll be able to sync

I don't see in awx an option to specify a venv or another...


You may need to create a second venv so as the drop down menu to be present.



PS: Something else that may help, try to hack the ovirt4.py with
ansible_host if you want to call the hosts into playbook by the
hostname and not the first IP:

vi

/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/awx/plugins/inventory/ovirt4.py

'affinity_labels': [label.name  forlabelinlabels],
## ajout NBT pour obtenir le nom de l'hote a la place de l ip
'ansible_host': vm.name ,
'affinity_groups': [


I will investigate, thanks.
Gianluca


--
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
blanc...@abes.fr

___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@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/THLWR2HQWZJAM336DTN6MLKBO26ZEJKZ/


[ovirt-users] Re: AWX and error using ovirt as an inventory source

2019-11-28 Thread Nathanaël Blanchet


Le 28/11/2019 à 16:59, Nathanaël Blanchet a écrit :


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

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)


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 forgot to precise python2 (some ovirt ansible module fail with py3)

# /opt/rh/rh-python36/root/usr/bin/awx-create-venv (-e 
/var/lib/awx/venv/) -n ovirt -p 2


  * source /var/lib/awx/venv/ovirt/bin/activate
  * # (ovirt) export PYCURL_SSL_LIBRARY=nss; pip install pycurl
--compile --no-cache-dir


 * # (ovirt) pip install ovirt-engine-sdk-python ansible psutil
   python-memcached


  * choose this venv instead of the regular in your inventory page and
you'll be able to sync

PS: Something else that may help, try to hack the ovirt4.py with 
ansible_host if you want to call the hosts into playbook by the 
hostname and not the first IP:


vi 
/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/awx/plugins/inventory/ovirt4.py


'affinity_labels': [label.name forlabelinlabels],
## ajout NBT pour obtenir le nom de l'hote a la place de l ip
'ansible_host': vm.name,
'affinity_groups': [


Le 28/11/2019 à 15:51, Gianluca Cecchi a écrit :

Hello,
I have awx 9.0.1 and ansible 2.8.5 in container of a CentOS 7.7 server.
I'm trying to use oVirt 4.3.6.7-1.el7 as a source of an inventory in 
awx but I get error when syncing


Find at bottom below the error messages.
I see that in recent past (around June this year) there were some 
problems, but they should be solved now, correct?
There was also a problem in syncing when some powered off VMs were 
present in oVirt env, but I think this solved too, correct?


Any way to replicate / test from command line of awx container?
I try some things but in command line I always get error regarding

oVirt inventory script requires ovirt-engine-sdk-python >= 4.0.0

that I think depends on not using correct command line and/or not 
setting needed env.


Thanks in advance,
Gianluca

    2.536 INFO     Updating inventory 4: MYDC_OVIRT
    3.011 INFO     Reading Ansible inventory source: 
/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/plugins/inventory/ovirt4.py

    3.013 INFO     Using VIRTUAL_ENV: /var/lib/awx/venv/ansible
    3.013 INFO     Using PATH: 
/var/lib/awx/venv/ansible/bin:/var/lib/awx/venv/awx/bin:/var/lib/awx/venv/awx/bin:/var/lib/awx/venv/awx/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    3.013 INFO     Using PYTHONPATH: 
/var/lib/awx/venv/ansible/lib/python3.6/site-packages:

Traceback (most recent call last):
  File "/var/lib/awx/venv/awx/bin/awx-manage", line 11, in 
    load_entry_point('awx==9.0.1.0', 'console_scripts', 'awx-manage')()
  File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/__init__.py", 
line 158, in manage

    execute_from_command_line(sys.argv)
  File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/__init__.py", 
line 381, in execute_from_command_line

    utility.execute()
  File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/__init__.py", 
line 375, in execute

    self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py", 
line 323, in run_from_argv

    self.execute(*args, **cmd_options)
  File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py", 
line 364, in execute

    output = self.handle(*args, **options)
  File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/inventory_import.py", 
line 1153, in handle

    raise exc
  File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/inventory_import.py", 
line 1043, in handle

    venv_path=venv_path, verbosity=self.verbosity).load()
  File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/inventory_import.py", 
line 214, in load

    return self.command_to_json(base_args + ['--list'])
  File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/inventory_import.py", 
line 197, in command_to_json

    self.method, proc.returncode, stdout, stderr))
RuntimeError: ansible-inventory failed (rc=1) with stdout:
stderr:
ansible-inventory 2.8.5
  config file = /etc/ansible/ansible.cfg
  configured module search path = 
['/var/lib/awx/.ansible/plugins/modules', 
'/usr/share/ansible/plugins/modules']
  ansible python module location = 
/usr/lib/python3.6/site-packages/ansible

  executable location = /usr/bin/ansible-inventory
  python version = 3.6.8 (default, Oct  7 2019, 17:58:22) [GCC 8.2.1 

[ovirt-users] Re: AWX and error using ovirt as an inventory source

2019-11-28 Thread Gianluca Cecchi
On Thu, Nov 28, 2019 at 4:59 PM Nathanaël Blanchet  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

> 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...


>
>- source /var/lib/awx/venv/ovirt/bin/activate
>
> as root correct? and I should source the just created venv, correct?

>
>- # (ovirt) export PYCURL_SSL_LIBRARY=nss; pip install pycurl
>--compile --no-cache-dir
>
> I presume (ovirt) is a sort of prompt of the venv
Will the settings preserved across reboot of the server hosting the
container?

>
>- choose this venv instead of the regular in your inventory page and
>you'll be able to sync
>
> I don't see in awx an option to specify a venv or another...

> PS: Something else that may help, try to hack the ovirt4.py with
> ansible_host if you want to call the hosts into playbook by the hostname
> and not the first IP:
>
> vi
> /opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/awx/plugins/inventory/ovirt4.py
> 'affinity_labels': [label.name for label in labels],
> ## ajout NBT pour obtenir le nom de l'hote a la place de l ip
> 'ansible_host': vm.name,
> 'affinity_groups': [
>
>
> I will investigate, thanks.
Gianluca
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@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/5K5PIGNREQJQ5O54FLSTW7O2DS5LF2NR/


[ovirt-users] Re: AWX and error using ovirt as an inventory source

2019-11-28 Thread Nathanaël Blanchet

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

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)


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
 * source /var/lib/awx/venv/ovirt/bin/activate
 * # (ovirt) export PYCURL_SSL_LIBRARY=nss; pip install pycurl
   --compile --no-cache-dir
 * choose this venv instead of the regular in your inventory page and
   you'll be able to sync

PS: Something else that may help, try to hack the ovirt4.py with 
ansible_host if you want to call the hosts into playbook by the hostname 
and not the first IP:


vi 
/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/awx/plugins/inventory/ovirt4.py


'affinity_labels': [label.name forlabelinlabels],
## ajout NBT pour obtenir le nom de l'hote a la place de l ip
'ansible_host': vm.name,
'affinity_groups': [


Le 28/11/2019 à 15:51, Gianluca Cecchi a écrit :

Hello,
I have awx 9.0.1 and ansible 2.8.5 in container of a CentOS 7.7 server.
I'm trying to use oVirt 4.3.6.7-1.el7 as a source of an inventory in 
awx but I get error when syncing


Find at bottom below the error messages.
I see that in recent past (around June this year) there were some 
problems, but they should be solved now, correct?
There was also a problem in syncing when some powered off VMs were 
present in oVirt env, but I think this solved too, correct?


Any way to replicate / test from command line of awx container?
I try some things but in command line I always get error regarding

oVirt inventory script requires ovirt-engine-sdk-python >= 4.0.0

that I think depends on not using correct command line and/or not 
setting needed env.


Thanks in advance,
Gianluca

    2.536 INFO     Updating inventory 4: MYDC_OVIRT
    3.011 INFO     Reading Ansible inventory source: 
/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/plugins/inventory/ovirt4.py

    3.013 INFO     Using VIRTUAL_ENV: /var/lib/awx/venv/ansible
    3.013 INFO     Using PATH: 
/var/lib/awx/venv/ansible/bin:/var/lib/awx/venv/awx/bin:/var/lib/awx/venv/awx/bin:/var/lib/awx/venv/awx/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    3.013 INFO     Using PYTHONPATH: 
/var/lib/awx/venv/ansible/lib/python3.6/site-packages:

Traceback (most recent call last):
  File "/var/lib/awx/venv/awx/bin/awx-manage", line 11, in 
    load_entry_point('awx==9.0.1.0', 'console_scripts', 'awx-manage')()
  File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/__init__.py", 
line 158, in manage

    execute_from_command_line(sys.argv)
  File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/__init__.py", 
line 381, in execute_from_command_line

    utility.execute()
  File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/__init__.py", 
line 375, in execute

    self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py", 
line 323, in run_from_argv

    self.execute(*args, **cmd_options)
  File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py", 
line 364, in execute

    output = self.handle(*args, **options)
  File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/inventory_import.py", 
line 1153, in handle

    raise exc
  File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/inventory_import.py", 
line 1043, in handle

    venv_path=venv_path, verbosity=self.verbosity).load()
  File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/inventory_import.py", 
line 214, in load

    return self.command_to_json(base_args + ['--list'])
  File 
"/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/inventory_import.py", 
line 197, in command_to_json

    self.method, proc.returncode, stdout, stderr))
RuntimeError: ansible-inventory failed (rc=1) with stdout:
stderr:
ansible-inventory 2.8.5
  config file = /etc/ansible/ansible.cfg
  configured module search path = 
['/var/lib/awx/.ansible/plugins/modules', 
'/usr/share/ansible/plugins/modules']
  ansible python module location = 
/usr/lib/python3.6/site-packages/ansible

  executable location = /usr/bin/ansible-inventory
  python version = 3.6.8 (default, Oct  7 2019, 17:58:22) [GCC 8.2.1 
20180905 (Red Hat 8.2.1-3)]

Using /etc/ansible/ansible.cfg as config file
 [WARNING]:  * Failed to parse /var/lib/awx/venv/awx/lib64/python3.6/site-
packages/awx/plugins/inventory/ovirt4.py with script plugin: Inventory 
script

(/var/lib/awx/venv/awx/lib64/python3.6/site-
packages/awx/plugins/inventory/ovirt4.py)