kolla-ansible/ansible/roles/prechecks/tasks/package_checks.yml
Dincer Celik 63ab53195c Adds maximum supported version check for Ansible
Maximum supported version is set to 2.9

Updated the minimum supported version to 2.8

Implements: blueprint ansible-max-version

Change-Id: I97cc95e37f49886e6d74f2d5a789b923b14b5a2d
2020-01-09 09:54:22 +03:00

19 lines
945 B
YAML

---
- name: Checking docker SDK version
command: "{{ ansible_python.executable }} -c \"import docker; print(docker.__version__)\""
register: result
changed_when: false
when: inventory_hostname in groups['baremetal']
failed_when: result is failed or result.stdout is version(docker_py_version_min, '<')
# NOTE(osmanlicilegi): ansible_version.full includes patch number that's useless
# to check. as ansible_version does not provide major.minor in dict, we need to
# set it as variable.
- name: Checking Ansible version
vars:
ansible_version_host: "{{ ansible_version.major }}.{{ ansible_version.minor }}"
fail:
msg: "Ansible version should be between {{ ansible_version_min }} and {{ ansible_version_max }}. Current version is {{ ansible_version.full }} which is not supported."
run_once: true
when: ansible_version_host is version(ansible_version_min, '<') or ansible_version_host is version(ansible_version_max, '>')