openstack.cloud

Hi all,

Could you help me, hogy to use openstack.cloud module in AWX?
I’m just start using AWX, looks great and very promising. I have experiences in ansible, maybe not so much but I can use and complete my tasks.

This openstack.cloud modul would be nice for me to my new project but I faced always with an error that openstacksdk module is required. I checked the available collections and pip list where I can see the openstacksdk is there and the openstack.cloud collection also available.

So, what should I set / use to have connection with my openstack and operate there,
I also create an openstack credential in the AWX but still nothing.
I checked the openstacksdk site and the examples are worked for me, like listing images and so on. I created my clouds.yaml file, however I don’t know this clouds.yaml file is needed here in AWX or the openstack credention is enough?

Thanks for your help.
Br,
Istvan

Hi,

I checked the issue more deeply and set the verbosity to 5 and I found the following results:
at the beginning it show that the awx container has python 3.8
// I’m using the awx-operator with 1.1.2 helm version
"
ansible-playbook [core 2.12.5.post0]
config file = None
configured module search path = [‘/home/runner/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]
ansible python module location = **/usr/local/lib/python3.8/**site-packages/ansible
ansible collection location = /runner/requirements_collections:/home/runner/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible-playbook
python version = 3.8.13 (default, Jun 24 2022, 15:27:57) [GCC 8.5.0 20210514 (Red Hat 8.5.0-13)]
jinja version = 2.11.3
libyaml = True
No config file found; using defaults
setting up inventory plugins
host_list declined parsing /runner/inventory/hosts as it did not pass its verify_file() method
Parsed /runner/inventory/hosts inventory source with script plugin
Loading collection openstack.cloud from /usr/share/ansible/collections/ansible_collections/openstack/cloud
Loading callback plugin default of type stdout, v2.0 from /usr/local/lib/python3.8/site-packages/ansible/plugins/callback/default.py
Loading callback plugin awx_display of type stdout, v2.0 from /usr/local/lib/python3.8/site-packages/ansible_runner/display_callback/callback/awx_display.py
Attempting to use ‘awx_display’ callback.
Skipping callback ‘awx_display’, as we already have a stdout callback.
Attempting to use ‘default’ callback.
Skipping callback ‘default’, as we already have a stdout callback.
Attempting to use ‘junit’ callback.
Attempting to use ‘minimal’ callback.
Skipping callback ‘minimal’, as we already have a stdout callback.
Attempting to use ‘oneline’ callback.
Skipping callback ‘oneline’, as we already have a stdout callback.
Attempting to use ‘tree’ callback.

"
then later where I would like to check the openstack.cloud task I’ve got this error:
"
Including module_utils file ansible/module_utils/errors.py
Including module_utils file ansible/module_utils/parsing/convert_bool.py
Including module_utils file ansible/module_utils/parsing/init.py
Including module_utils file ansible/module_utils/pycompat24.py
Including module_utils file ansible/module_utils/six/init.py
Including module_utils file ansible_collections/openstack/cloud/plugins/module_utils/openstack.py
Including module_utils file ansible/module_utils/compat/version.py
Including module_utils file ansible_collections/init.py
Including module_utils file ansible_collections/openstack/init.py
Including module_utils file ansible_collections/openstack/cloud/init.py
Including module_utils file ansible_collections/openstack/cloud/plugins/init.py
Including module_utils file ansible_collections/openstack/cloud/plugins/module_utils/init.py
Using module file /usr/share/ansible/collections/ansible_collections/openstack/cloud/plugins/modules/network.py
PUT /home/runner/.ansible/tmp/ansible-local-19rjw3w42a/tmpbrslzyy5 TO /home/runner/.ansible/tmp/ansible-tmp-1671359442.33985-83-174751387099332/AnsiballZ_network.py
EXEC /bin/sh -c ‘chmod u+x /home/runner/.ansible/tmp/ansible-tmp-1671359442.33985-83-174751387099332/ /home/runner/.ansible/tmp/ansible-tmp-1671359442.33985-83-174751387099332/AnsiballZ_network.py && sleep 0’
EXEC /bin/sh -c ‘/usr/libexec/platform-python /home/runner/.ansible/tmp/ansible-tmp-1671359442.33985-83-174751387099332/AnsiballZ_network.py && sleep 0’
EXEC /bin/sh -c ‘rm -f -r /home/runner/.ansible/tmp/ansible-tmp-1671359442.33985-83-174751387099332/ > /dev/null 2>&1 && sleep 0’
The full traceback is:
File “/tmp/ansible_openstack.cloud.network_payload_vnvg675s/ansible_openstack.cloud.network_payload.zip/ansible_collections/openstack/cloud/plugins/module_utils/openstack.py”, line 356, in openstack_cloud_from_module
sdk = importlib.import_module(‘openstack’)
File “/usr/lib64/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 953, in _find_and_load_unlocked
fatal: [local]: FAILED! => {
“changed”: false,
“invocation”: {
“module_args”: {
“admin_state_up”: true,
“api_timeout”: null,
“auth”: null,

"

I’m not so familiar in python programing, but it seems this component looking for a different openstacksdk which is definitely not there.
Does it a bug or I did something wrong?

Could you help me in this topic?

Thanks,
Istvan

István Tóth <pii198@gmail.com> ezt írta (időpont: 2022. dec. 17., Szo, 16:55):

Hi!

Are you using the default awx version with operator 1.1.2, which should be v21.10.1?

AWX Team