diff --git a/ansible/roles/prechecks/tasks/package_checks.yml b/ansible/roles/prechecks/tasks/package_checks.yml index 55cd12ccff..49d2037c4e 100644 --- a/ansible/roles/prechecks/tasks/package_checks.yml +++ b/ansible/roles/prechecks/tasks/package_checks.yml @@ -7,7 +7,6 @@ result.stdout | version_compare(docker_py_version_min, '<') - name: Checking Ansible version - local_action: command ansible --version - register: result - changed_when: false - failed_when: result.stdout | regex_replace('ansible (\\d+\\.\\d+\\.\\d+)', '\\1') | version_compare(ansible_version_min, '<') + local_action: fail msg="Current Ansible version {{ ansible_version.full }} is less than {{ ansible_version_min }}" + run_once: true + when: ansible_version.full | version_compare(ansible_version_min, '<')