- remove private attribute with import_role.
- update documentation.
- update rpm spec requirement.
- fix MagicMock python import in unit tests.
Closes: #3765
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
BuildArch: noarch
-BuildRequires: ansible >= 2.7
-Requires: ansible >= 2.7
+BuildRequires: ansible >= 2.8
+Requires: ansible >= 2.8
%if 0%{?rhel} == 7
BuildRequires: python2-devel
- ``stable-3.2`` Supports Ceph versions ``luminous`` and ``mimic``. This branch requires Ansible version ``2.6``.
-- ``stable-4.0`` Supports Ceph version ``nautilus``. This branch requires Ansible version ``2.7``.
+- ``stable-4.0`` Supports Ceph version ``nautilus``. This branch requires Ansible version ``2.8``.
-- ``master`` Supports Ceph@master version. This branch requires Ansible version ``2.7``.
+- ``master`` Supports Ceph@master version. This branch requires Ansible version ``2.8``.
Configuration and Usage
=======================
- import_role:
name: ceph-defaults
- private: false
- name: gather monitors facts
setup:
- import_role:
name: ceph-facts
- private: false
- name: get all the running osds
shell: |
- import_role:
name: ceph-defaults
- private: false
- import_role:
name: ceph-facts
- private: false
- name: show container list on all the nodes (should be empty)
command: >
from . import ceph_volume
-from ansible.compat.tests.mock import MagicMock
import mock
import os
+# Python 3
+try:
+ from unittest.mock import MagicMock
+except ImportError:
+ # Python 2
+ try:
+ from mock import MagicMock
+ except ImportError:
+ print('You need the mock library installed on python2.x to run tests')
+
+
@mock.patch.dict(os.environ, {'CEPH_CONTAINER_BINARY': 'docker'})
class TestCephVolumeModule(object):
# These are Python requirements needed to run ceph-ansible master
notario>=0.0.13
-ansible~=2.7,<2.8
+ansible>=2.8,<2.9
netaddr
- name: fail on unsupported ansible version (1.X)
fail:
- msg: "Ansible version must be >= 2.7.x, please update!"
+ msg: "Ansible version must be >= 2.8.x, please update!"
when: ansible_version.major|int < 2
- name: fail on unsupported ansible version
fail:
- msg: "Ansible version must be 2.7 or 2.8!"
+ msg: "Ansible version must be 2.8!"
when:
- ansible_version.major|int == 2
- - ansible_version.minor|int not in [7, 8]
+ - ansible_version.minor|int != 8
- name: fail if systemd is not present
fail:
pytest-xdist==1.27.0
pytest==3.6.1
notario>=0.0.13
-ansible~=2.7,<2.8
+ansible>=2.8,<2.9
netaddr
mock
jmespath