From 1ccccbcf0ad6ffa0e5ce42e6cf97808680da1734 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Nasiadka?= <mnasiadka@gmail.com>
Date: Thu, 18 Feb 2021 12:16:48 +0100
Subject: [PATCH] Bump up supported Ansible version to 2.10

Min version stays as 2.9

Change-Id: I7ec8c5eb36757248c9aa016dc7d4e495ec5bb635
---
 ansible/roles/prechecks/vars/main.yml | 2 +-
 doc/source/user/quickstart.rst        | 8 ++++----
 test-requirements.txt                 | 2 +-
 tests/run.yml                         | 2 +-
 tools/kolla-ansible                   | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/ansible/roles/prechecks/vars/main.yml b/ansible/roles/prechecks/vars/main.yml
index 29773ddd5..a367717c7 100644
--- a/ansible/roles/prechecks/vars/main.yml
+++ b/ansible/roles/prechecks/vars/main.yml
@@ -2,7 +2,7 @@
 docker_version_min: '1.10.0'
 docker_py_version_min: '2.0.0'
 ansible_version_min: '2.9'
-ansible_version_max: '2.9'
+ansible_version_max: '2.10'
 
 # Top level keys should match ansible_distribution.
 # These map to lists of supported releases (ansible_distribution_release) or
diff --git a/doc/source/user/quickstart.rst b/doc/source/user/quickstart.rst
index 4d12769f6..3c21a1dd7 100644
--- a/doc/source/user/quickstart.rst
+++ b/doc/source/user/quickstart.rst
@@ -89,11 +89,11 @@ If not installing Kolla Ansible in a virtual environment, skip this section.
       pip install -U pip
 
 #. Install `Ansible <http://www.ansible.com>`__. Kolla Ansible requires at least
-   Ansible ``2.9`` and supports up to ``2.9``.
+   Ansible ``2.9`` and supports up to ``2.10``.
 
    .. code-block:: console
 
-      pip install 'ansible<2.10'
+      pip install 'ansible<3.0'
 
 Install dependencies not using a virtual environment
 ----------------------------------------------------
@@ -121,7 +121,7 @@ If installing Kolla Ansible in a virtual environment, skip this section.
       sudo pip3 install -U pip
 
 #. Install `Ansible <http://www.ansible.com>`__. Kolla Ansible requires at least
-   Ansible ``2.9`` and supports up to ``2.9``.
+   Ansible ``2.9`` and supports up to ``2.10``.
 
    For CentOS or RHEL, run:
 
@@ -138,7 +138,7 @@ If installing Kolla Ansible in a virtual environment, skip this section.
    .. note::
 
       If the installed Ansible version does not meet the requirements, one can
-      use pip: ``sudo pip install -U 'ansible<2.10'``.
+      use pip: ``sudo pip install -U 'ansible<3.0'``.
       Beware system package upgrades might interfere with that so it
       is recommended to uninstall the system package first. One might be better
       off with the virtual environment method to avoid this pitfall.
diff --git a/test-requirements.txt b/test-requirements.txt
index 77c7b43c1..8b10965c0 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -13,4 +13,4 @@ coverage!=4.4,>=4.0 # Apache-2.0
 docker>=2.4.2 # Apache-2.0
 oslotest>=3.2.0 # Apache-2.0
 stestr>=2.0.0 # Apache-2.0
-ansible>=2.9.0,<2.10 # GPLv3
+ansible>=2.9.0,<3.0 # GPLv3
diff --git a/tests/run.yml b/tests/run.yml
index 380bf8fb7..366b744bd 100644
--- a/tests/run.yml
+++ b/tests/run.yml
@@ -214,7 +214,7 @@
     - name: install kolla-ansible and dependencies
       vars:
         # Test latest ansible version on Ubuntu, minimum supported on others.
-        ansible_version_constraint: "==2.9.*"
+        ansible_version_constraint: "{{ '==2.9.*' if is_upgrade else '==2.10.*' }}"
       pip:
         name:
           - "{{ kolla_ansible_src_dir }}"
diff --git a/tools/kolla-ansible b/tools/kolla-ansible
index 56e675e8a..9792083e7 100755
--- a/tools/kolla-ansible
+++ b/tools/kolla-ansible
@@ -55,7 +55,7 @@ function check_environment_coherence {
     fi
 
     local ANSIBLE_VERSION_MIN=2.9
-    local ANSIBLE_VERSION_MAX=2.9
+    local ANSIBLE_VERSION_MAX=2.10
 
     if [[ $(printf "%s\n" "$ANSIBLE_VERSION_MIN" "$ANSIBLE_VERSION_MAX" "$ansible_version" | sort -V | head -n1) != "$ANSIBLE_VERSION_MIN" ]] ||
        [[ $(printf "%s\n" "$ANSIBLE_VERSION_MIN" "$ANSIBLE_VERSION_MAX" "$ansible_version" | sort -V | tail -n1) != "$ANSIBLE_VERSION_MAX" ]]; then
-- 
GitLab