]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
switch to ansible 2.8
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 9 Apr 2019 07:22:06 +0000 (09:22 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 20 May 2019 11:04:58 +0000 (13:04 +0200)
- 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>
ceph-ansible.spec.in
docs/source/index.rst
infrastructure-playbooks/purge-docker-cluster.yml
library/test_ceph_volume.py
requirements.txt
roles/ceph-validate/tasks/check_system.yml
tests/requirements.txt

index a5e2df327e60db884ebe4180fbc491c4ed3a6dbe..6c8d80a9d05668155f974f3e7ccaa686a0d83939 100644 (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
index 2eac849e561ecd426e51d14b046ffb7b5948a898..56bfd43a8a1e0a129ea2301281b9ace2c4248f8f 100644 (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
 =======================
index f31477df887094445bde62e68e53d3e2ecf50524..f2fda8d171e0351bc634e6bc7143b8bdd8a1049c 100644 (file)
 
   - 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: >
index a4688dc092dc2a1736816f251ddb385ab3b3373a..e58b93bdbcd14940dfa03e05cc08e93c4b6b8272 100644 (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):
 
index f6dd4ddfeec8ea51cba11d45803956a8255980d6..60fa2b3b18c19667a5706e0d19a9bfe75381544f 100644 (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
index 4a538f9a855b0e723a646d9b02c5acceba314720..cec5b7f654c10567a1d385858effd69bcc6e637d 100644 (file)
 
 - 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:
index 8f89d8073630a086a712e4d7e323b66ae23f04cf..520e292c3f67917f54b0e8e202e33796e7fc3225 100644 (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