diff options
| author | MichaĆ Nasiadka <mnasiadka@gmail.com> | 2021-06-17 08:16:11 +0200 |
|---|---|---|
| committer | Michal Nasiadka <mnasiadka@gmail.com> | 2021-09-23 10:45:31 +0000 |
| commit | 1b650534c0046ae14edc45acef032148bdae6a83 (patch) | |
| tree | ee388a80169ca60a07f95ab4bb197ba4804e80f6 | |
| parent | d8641e90c3c71cc875e90d0c39e6c3ea514a1bda (diff) | |
| download | kolla-ansible-1b650534c0046ae14edc45acef032148bdae6a83.tar.gz kolla-ansible-1b650534c0046ae14edc45acef032148bdae6a83.zip | |
Bump up Ansible max supported ver to 4.x
This change bumps up max supported Ansible version
to 4.x (ansible-core 2.11.x) and minimum to 2.10.
Change-Id: I8b9212934dfab3831986e8db55671baee32f4bbd
| -rw-r--r-- | ansible/library/kolla_toolbox.py | 8 | ||||
| -rw-r--r-- | ansible/roles/prechecks/vars/main.yml | 4 | ||||
| -rw-r--r-- | doc/source/user/quickstart.rst | 6 | ||||
| -rw-r--r-- | releasenotes/notes/ansible-4-171c8afddfc325e8.yaml | 5 | ||||
| -rw-r--r-- | test-requirements.txt | 2 | ||||
| -rw-r--r-- | tests/run.yml | 2 | ||||
| -rwxr-xr-x | tools/kolla-ansible | 4 |
7 files changed, 21 insertions, 10 deletions
diff --git a/ansible/library/kolla_toolbox.py b/ansible/library/kolla_toolbox.py index c860c33bc..3a613ef01 100644 --- a/ansible/library/kolla_toolbox.py +++ b/ansible/library/kolla_toolbox.py @@ -19,8 +19,11 @@ import docker import json import re +from ansible.module_utils.ansible_release import __version__ as ansible_version from ansible.module_utils.basic import AnsibleModule +from ast import literal_eval + DOCUMENTATION = ''' --- module: kolla_toolbox @@ -108,7 +111,10 @@ def gen_commandline(params): if params.get('module_name'): command.extend(['-m', params.get('module_name')]) if params.get('module_args'): - module_args = params.get('module_args') + if StrictVersion(ansible_version) < StrictVersion('2.11.0'): + module_args = params.get('module_args') + else: + module_args = literal_eval(params.get('module_args')) if isinstance(module_args, dict): module_args = ' '.join("{}='{}'".format(key, value) for key, value in module_args.items()) diff --git a/ansible/roles/prechecks/vars/main.yml b/ansible/roles/prechecks/vars/main.yml index 8e4a7e437..ea32bd291 100644 --- a/ansible/roles/prechecks/vars/main.yml +++ b/ansible/roles/prechecks/vars/main.yml @@ -1,8 +1,8 @@ --- docker_version_min: '18.09' docker_py_version_min: '3.4.1' -ansible_version_min: '2.9' -ansible_version_max: '2.10' +ansible_version_min: '2.10' +ansible_version_max: '2.11' # Top level keys should match ansible_facts.distribution. # These map to lists of supported releases (ansible_facts.distribution_release) or diff --git a/doc/source/user/quickstart.rst b/doc/source/user/quickstart.rst index 0a954bc41..060ac25ee 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.10``. + Ansible ``2.10`` and supports up to ``4``. .. code-block:: console - pip install 'ansible<3.0' + pip install 'ansible<5.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.10``. + Ansible ``2.10`` and supports up to ``4``. For CentOS or RHEL, run: diff --git a/releasenotes/notes/ansible-4-171c8afddfc325e8.yaml b/releasenotes/notes/ansible-4-171c8afddfc325e8.yaml new file mode 100644 index 000000000..9360c563a --- /dev/null +++ b/releasenotes/notes/ansible-4-171c8afddfc325e8.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - | + Minimum supported Ansible version is now ``2.10`` and maximum supported + is ``4`` (ansible-core 2.11). diff --git a/test-requirements.txt b/test-requirements.txt index 8b10965c0..ef84c6b8a 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,<3.0 # GPLv3 +ansible>=2.10.0,<5.0 # GPLv3 diff --git a/tests/run.yml b/tests/run.yml index 7f3c95329..6b5b90b73 100644 --- a/tests/run.yml +++ b/tests/run.yml @@ -203,7 +203,7 @@ - name: install kolla-ansible and dependencies vars: # Test latest ansible version on Ubuntu, minimum supported on others. - ansible_version_constraint: "{{ '==2.9.*' if is_upgrade else '==2.10.*' }}" + ansible_version_constraint: "{{ '==2.10.*' if is_upgrade else '==4.*' }}" command: >- python3 -m pip install --user -c {{ upper_constraints_file }} diff --git a/tools/kolla-ansible b/tools/kolla-ansible index a6d222b7a..1826b3d4e 100755 --- a/tools/kolla-ansible +++ b/tools/kolla-ansible @@ -55,8 +55,8 @@ function check_environment_coherence { exit 1 fi - local ANSIBLE_VERSION_MIN=2.9 - local ANSIBLE_VERSION_MAX=2.10 + local ANSIBLE_VERSION_MIN=2.10 + local ANSIBLE_VERSION_MAX=2.11 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 |
