Files
kolla-ansible/ansible/roles/prechecks/tasks/package_checks.yml
Ivan Halomi 652b9cfe0e Removal of dockerSDK check for other container engines
Typo fix and adding condition on not checking docker SDK version
when container engine is not docker

This is a followup to Ic30b67daa2e215524096ad1f4385c569e3d41b95
Signed-off-by: Ivan Halomi <i.halomi@partner.samsung.com>
Change-Id: Iafa24db06ad46bcfe250451ed98bc3c48d8a5138
2022-11-28 12:11:11 +00:00

23 lines
1011 B
YAML

---
- name: Checking docker SDK version
command: "{{ ansible_facts.python.executable }} -c \"import docker; print(docker.__version__)\""
register: result
changed_when: false
when:
- inventory_hostname in groups['baremetal']
- kolla_container_engine == 'docker'
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, '>')