In this document we will explain how one could setup their Mac for AgnosticD deployment with OpenStack and the known issues to date.
If you are a Red Hatter, you can use labs.opentlc.com to request access to our OpenStack cluster. . Log in to https://labs.opentlc.com using your opentlc user. . Go to Services → Catalogs → Novello testing → DEV OSP Sandbox. . Click Order → Submit
-
Error when executing test playbook:
sassenach:ansible Cibeles$ ansible-playbook main.yml \ -e @configs/test-empty-config/sample_vars_osp.yml \ -e @~/.config/openstack/secret.yml [...] TASK [infra-osp-dry-run : Delete Heat stack that doesn't exist] ******************************************************** Monday 25 May 2020 15:48:17 +0200 (0:00:00.832) 0:00:11.583 ************ fatal: [localhost]: FAILED! => {"changed": false, "msg": "openstacksdk is required for this module"} to retry, use: --limit @/Users/Cibeles/repos/agnosticd/ansible/main.retry PLAY RECAP ************************************************************************************************************* localhost : ok=16 changed=2 unreachable=0 failed=1
You probably forgot to create or activate your virtual env, to fix this simply run:
+
$ source /Users/[USER]/.pyenv/versions/openstack-ansible-2.9/bin/activate
Please note, now your prompt changes to something like: "(openstack-ansible-2.9) sassenach:ansible Cibeles$"
-
Error still persist, even you have activated virtual env, when executing test playbook:
(openstack-ansible-2.9) sassenach:ansible Cibeles$ ansible-playbook main.yml \ -e @configs/test-empty-config/sample_vars_osp.yml \ -e @~/.config/openstack/secret.yml [...] TASK [infra-osp-dry-run : Delete Heat stack that doesn't exist] ******************************************************* Monday 25 May 2020 15:51:21 +0200 (0:00:00.828) 0:00:11.392 *********** fatal: [localhost]: FAILED! => {"changed": false, "msg": "openstacksdk is required for this module"}
You need to install openstacksdk.
+
sassenach:~ Cibeles$ pip install openstacksdk
For further information, please refer to link:openstack doc[https://docs.openstack.org/openstacksdk/latest/user/]
-
After installing openstacksdk, I still get same error when running test playbook.
You may be having version issues. Try the following troubleshooting steps:
+
(openstack-ansible-2.9) sassenach:ansible Cibeles$ /Users/Cibeles/.pyenv/versions/openstack-ansible-2.9/bin/pip list |grep openstack
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. 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
openstacksdk 0.45.0
WARNING: You are using pip version 20.0.2; however, version 20.1.1 is available.
You should consider upgrading via the '/Users/Cibeles/.pyenv/versions/openstack-ansible-2.9/bin/python -m pip install --upgrade pip' command.
(openstack-ansible-2.9) sassenach:ansible Cibeles$ python --version
Python 2.7.16
sassenach:~ Cibeles$ python -mopenstack version
Traceback (most recent call last):
File "/opt/pkg/lib/python2.7/runpy.py", line 163, in _run_module_as_main
mod_name, _Error)
File "/opt/pkg/lib/python2.7/runpy.py", line 111, in _get_module_details
__import__(mod_name) # Do not catch exceptions initializing package
File "/Users/Cibeles/.local/lib/python2.7/site-packages/openstack/__init__.py", line 16, in <module>
import openstack.config
File "/Users/Cibeles/.local/lib/python2.7/site-packages/openstack/config/__init__.py", line 17, in <module>
from openstack.config.loader import OpenStackConfig # noqa
File "/Users/Cibeles/.local/lib/python2.7/site-packages/openstack/config/loader.py", line 33, in <module>
from openstack.config import cloud_region
File "/Users/Cibeles/.local/lib/python2.7/site-packages/openstack/config/cloud_region.py", line 44, in <module>
from openstack import proxy
File "/Users/Cibeles/.local/lib/python2.7/site-packages/openstack/proxy.py", line 24, in <module>
from openstack import resource
File "/Users/Cibeles/.local/lib/python2.7/site-packages/openstack/resource.py", line 49, in <module>
from openstack import utils
File "/Users/Cibeles/.local/lib/python2.7/site-packages/openstack/utils.py", line 13, in <module>
import queue
ImportError: No module named queue
You need to install a compatible openstacksdk version with your installed Python version.
+
sassenach:~ Cibeles$ pip install openstacksdk==VERSION
-
When installing a given openstacksdk version, I get xcode errors:
sassenach:~ Cibeles$ pip install openstacksdk==0.31.0 [...] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h:204:2: error: unknown type name 'uint64_t' uint64_t ri_phys_footprint; ^
Try installing it with sudo:
+
sassenach:~ Cibeles$ sudo pip install openstacksdk==0.31.0
-
I’ve succesfully installed a different openstacksdk version with sudo, but test playbook still fails. At this point, you need to keep try and failure the following commands, till a combination of them make test playbook execute successfully: 5.1. Get all available openstacksdk versions:
sassenach:~ Cibeles$ sudo pip install openstacksdk==111 ERROR: Could not find a version that satisfies the requirement openstacksdk==111 (from versions: 0.6.0, 0.6.1, 0.6.2, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.8.5, 0.8.6, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.9.4, 0.9.5, 0.9.6, 0.9.7, 0.9.8, 0.9.9, 0.9.10, 0.9.11, 0.9.12, 0.9.13, 0.9.14, 0.9.15, 0.9.16, 0.9.17, 0.9.18, 0.9.19, 0.10.0, 0.11.0, 0.11.1, 0.11.2, 0.11.3, 0.11.4, 0.12.0, 0.13.0, 0.14.0, 0.15.0, 0.16.0, 0.17.0, 0.17.1, 0.17.2, 0.17.3, 0.18.0, 0.18.1, 0.19.0, 0.20.0, 0.21.0, 0.22.0, 0.23.0, 0.24.0, 0.25.0, 0.26.0, 0.27.0, 0.28.0, 0.29.0, 0.30.0, 0.31.0, 0.31.1, 0.31.2, 0.32.0, 0.33.0, 0.34.0, 0.35.0, 0.36.0, 0.36.1, 0.36.2, 0.36.3, 0.37.0, 0.38.0, 0.39.0, 0.40.0, 0.41.0, 0.42.0, 0.43.0, 0.44.0, 0.45.0, 0.46.0) ERROR: No matching distribution found for openstacksdk==111
5.2. Start trying with one of the versions and then check if it matches python’s version. Run the following 2 commands, till there is no error:
sassenach:~ Cibeles$ sudo pip install openstacksdk==0.43.0 sassenach:~ Cibeles$ python -mopenstack version OpenstackSDK Version 0.43.0
-
I’ve installed correctly openstacksdk with a version matching Python’s, and I still have errors when executing test playbook:
(openstack-ansible-2.9) sassenach:ansible Cibeles$ ansible-playbook main.yml -e @configs/test-empty-config/sample_vars_osp.yml -e @~/.config/openstack/secret.yml TASK [infra-osp-dry-run : Delete Heat stack that doesn't exist] ******************************************************* Wednesday 20 May 2020 14:28:41 +0200 (0:00:00.830) 0:00:11.773 ********* fatal: [localhost]: FAILED! => {"changed": false, "msg": "openstacksdk is required for this module"}
Try checking the Python version is ansible-playbook using:
+
(openstack-ansible-2.9) sassenach:ansible Cibeles$ ansible-playbook --version
ansible-playbook 2.6.4
config file = /Users/Cibeles/repos/agnosticd/ansible/ansible.cfg
configured module search path = [u'/Users/Cibeles/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /opt/pkg/lib/python2.7/site-packages/ansible
executable location = /opt/pkg/bin/ansible-playbook
python version = 2.7.16 (default, Mar 30 2019, 09:35:19) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]
(openstack-ansible-2.9) sassenach:ansible Cibeles$ sudo pip install -r https://raw.githubusercontent.com/redhat-cop/agnosticd/development/tools/virtualenvs/openstack-ansible-latest.txt