switch to ansible 2.8

- 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>
pull/4013/head
Guillaume Abrioux 2019-04-09 09:22:06 +02:00
parent 494746b7a6
commit 72d8315299
7 changed files with 20 additions and 14 deletions

View File

@ -16,8 +16,8 @@ Obsoletes: ceph-iscsi-ansible <= 1.5
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

View File

@ -77,9 +77,9 @@ The ``master`` branch should be considered experimental and used with caution.
- ``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
=======================

View File

@ -300,7 +300,6 @@
- import_role:
name: ceph-defaults
private: false
- name: gather monitors facts
setup:
@ -310,7 +309,6 @@
- import_role:
name: ceph-facts
private: false
- name: get all the running osds
shell: |
@ -589,11 +587,9 @@
- 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: >

View File

@ -1,9 +1,19 @@
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):

View File

@ -1,4 +1,4 @@
# 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

View File

@ -55,15 +55,15 @@
- 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:

View File

@ -4,7 +4,7 @@ testinfra==1.19.0
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