Seems that v2.0.0-0.2.alpha2 ansible install in kolla_ansible image is just broken (with centos binary container image at least):
[root@kolla kolla]# docker exec -it kolla_ansible bash
[root@kolla /]# ansible --version
Traceback (most recent call last):
File "/usr/bin/ansible", line 40, in <module>
from ansible.utils.display import Display
File "/usr/lib/python2.7/site-packages/ansible/utils/display.py", line 35, in <module>
from ansible import constants as C
File "/usr/lib/python2.7/site-packages/ansible/constants.py", line 30, in <module>
from ansible.parsing.splitter import unquote
File "/usr/lib/python2.7/site-packages/ansible/parsing/__init__.py", line 32, in <module>
from ansible.parsing.vault import VaultLib
File "/usr/lib/python2.7/site-packages/ansible/parsing/vault/__init__.py", line 82, in <module>
from cryptography.hazmat.primitives.hashes import SHA256 as c_SHA256
File "/usr/lib64/python2.7/site-packages/cryptography/hazmat/primitives/hashes.py", line 15, in <module>
from cryptography.hazmat.backends.interfaces import HashBackend
File "/usr/lib64/python2.7/site-packages/cryptography/hazmat/backends/__init__.py", line 9, in <module>
from cryptography.hazmat.backends.multibackend import MultiBackend
File "/usr/lib64/python2.7/site-packages/cryptography/hazmat/backends/multibackend.py", line 9, in <module>
from cryptography.hazmat.backends.interfaces import (
File "/usr/lib64/python2.7/site-packages/cryptography/hazmat/backends/interfaces.py", line 12, in <module>
@six.add_metaclass(abc.ABCMeta)
AttributeError: 'module' object has no attribute 'add_metaclass'
Simple workaround which seems to fix the issue is:
[root@kolla /]# pip install --upgrade ansible
Requirement already up-to-date: ansible in /usr/lib/python2.7/site-packages
Requirement already up-to-date: paramiko in /usr/lib/python2.7/site-packages (from ansible)
Requirement already up-to-date: jinja2 in /usr/lib64/python2.7/site-packages (from ansible)
Collecting PyYAML (from ansible)
Downloading PyYAML-3.11.tar.gz (248kB)
100% |################################| 249kB 721kB/s
Collecting setuptools (from ansible)
Downloading setuptools-19.2-py2.py3-none-any.whl (463kB)
100% |################################| 466kB 427kB/s
Requirement already up-to-date: pycrypto>=2.6 in /usr/lib64/python2.7/site-packages (from ansible)
Collecting six (from ansible)
Downloading six-1.10.0-py2.py3-none-any.whl
Requirement already up-to-date: ecdsa>=0.11 in /usr/lib/python2.7/site-packages (from paramiko->ansible)
Requirement already up-to-date: MarkupSafe in /usr/lib64/python2.7/site-packages (from jinja2->ansible)
Building wheels for collected packages: PyYAML
Running setup.py bdist_wheel for PyYAML
Stored in directory: /root/.cache/pip/wheels/fa/db/f6/dee55793d344f1706dc4a5a693298f0115241d1085cc212364
Successfully built PyYAML
Installing collected packages: PyYAML, setuptools, six
Found existing installation: PyYAML 3.10
DEPRECATION: Uninstalling a distutils installed project (PyYAML) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling PyYAML-3.10:
Successfully uninstalled PyYAML-3.10
Found existing installation: setuptools 0.9.8
Uninstalling setuptools-0.9.8:
Successfully uninstalled setuptools-0.9.8
Found existing installation: six 1.9.0
Uninstalling six-1.9.0:
Successfully uninstalled six-1.9.0
Successfully installed PyYAML-3.11 setuptools-19.2 six-1.10.0
IF replacing git pulled ansible with distro provided package (ie yum install ansible) instead - ansible will work - yet mysql module commands will return 'success' instead of 'SUCCESS' - and result parsing in ansible playbooks will fail:
--- EXAMPLE ---
localhost | success >> {
"changed": false,
"user": "haproxy"
}
--- EXAMPLE ---
Seems that v2.0.0-0.2.alpha2 ansible install in kolla_ansible image is just broken (with centos binary container image at least):
[root@kolla kolla]# docker exec -it kolla_ansible bash utils.display import Display python2. 7/site- packages/ ansible/ utils/display. py", line 35, in <module> python2. 7/site- packages/ ansible/ constants. py", line 30, in <module> parsing. splitter import unquote python2. 7/site- packages/ ansible/ parsing/ __init_ _.py", line 32, in <module> parsing. vault import VaultLib python2. 7/site- packages/ ansible/ parsing/ vault/_ _init__ .py", line 82, in <module> hazmat. primitives. hashes import SHA256 as c_SHA256 python2. 7/site- packages/ cryptography/ hazmat/ primitives/ hashes. py", line 15, in <module> hazmat. backends. interfaces import HashBackend python2. 7/site- packages/ cryptography/ hazmat/ backends/ __init_ _.py", line 9, in <module> hazmat. backends. multibackend import MultiBackend python2. 7/site- packages/ cryptography/ hazmat/ backends/ multibackend. py", line 9, in <module> hazmat. backends. interfaces import ( python2. 7/site- packages/ cryptography/ hazmat/ backends/ interfaces. py", line 12, in <module> add_metaclass( abc.ABCMeta)
[root@kolla /]# ansible --version
Traceback (most recent call last):
File "/usr/bin/ansible", line 40, in <module>
from ansible.
File "/usr/lib/
from ansible import constants as C
File "/usr/lib/
from ansible.
File "/usr/lib/
from ansible.
File "/usr/lib/
from cryptography.
File "/usr/lib64/
from cryptography.
File "/usr/lib64/
from cryptography.
File "/usr/lib64/
from cryptography.
File "/usr/lib64/
@six.
AttributeError: 'module' object has no attribute 'add_metaclass'
Simple workaround which seems to fix the issue is: python2. 7/site- packages python2. 7/site- packages (from ansible) python2. 7/site- packages (from ansible) ####### ####### ####### #####| 249kB 721kB/s 19.2-py2. py3-none- any.whl (463kB) ####### ####### ####### #####| 466kB 427kB/s python2. 7/site- packages (from ansible) 0-py2.py3- none-any. whl python2. 7/site- packages (from paramiko->ansible) python2. 7/site- packages (from jinja2->ansible) cache/pip/ wheels/ fa/db/f6/ dee55793d344f17 06dc4a5a693298f 0115241d1085cc2 12364
[root@kolla /]# pip install --upgrade ansible
Requirement already up-to-date: ansible in /usr/lib/
Requirement already up-to-date: paramiko in /usr/lib/
Requirement already up-to-date: jinja2 in /usr/lib64/
Collecting PyYAML (from ansible)
Downloading PyYAML-3.11.tar.gz (248kB)
100% |######
Collecting setuptools (from ansible)
Downloading setuptools-
100% |######
Requirement already up-to-date: pycrypto>=2.6 in /usr/lib64/
Collecting six (from ansible)
Downloading six-1.10.
Requirement already up-to-date: ecdsa>=0.11 in /usr/lib/
Requirement already up-to-date: MarkupSafe in /usr/lib64/
Building wheels for collected packages: PyYAML
Running setup.py bdist_wheel for PyYAML
Stored in directory: /root/.
Successfully built PyYAML
Installing collected packages: PyYAML, setuptools, six
Found existing installation: PyYAML 3.10
DEPRECATION: Uninstalling a distutils installed project (PyYAML) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling PyYAML-3.10:
Successfully uninstalled PyYAML-3.10
Found existing installation: setuptools 0.9.8
Uninstalling setuptools-0.9.8:
Successfully uninstalled setuptools-0.9.8
Found existing installation: six 1.9.0
Uninstalling six-1.9.0:
Successfully uninstalled six-1.9.0
Successfully installed PyYAML-3.11 setuptools-19.2 six-1.10.0
IF replacing git pulled ansible with distro provided package (ie yum install ansible) instead - ansible will work - yet mysql module commands will return 'success' instead of 'SUCCESS' - and result parsing in ansible playbooks will fail:
--- EXAMPLE ---
localhost | success >> {
"changed": false,
"user": "haproxy"
}
--- EXAMPLE ---