
As part of the effort to implement Ansible code linting in CI (using ansible-lint) - we need to implement recommendations from ansible-lint output [1]. One of them is to stop using local_action in favor of delegate_to - to increase readability and and match the style of typical ansible tasks. [1]: https://review.opendev.org/694779/ Partially implements: blueprint ansible-lint Change-Id: I46c259ddad5a6aaf9c7301e6c44cd8a1d5c457d3
14 lines
538 B
YAML
14 lines
538 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, '<')
|
|
|
|
- name: Checking Ansible version
|
|
fail:
|
|
msg: "Current Ansible version {{ ansible_version.full }} is less than {{ ansible_version_min }}"
|
|
run_once: true
|
|
when: ansible_version.full is version(ansible_version_min, '<')
|