Merge "ansible: Use assert on checks for readability"
This commit is contained in:
commit
5ee602fcf1
@ -20,11 +20,13 @@
|
|||||||
# to check. as ansible_version does not provide major.minor in dict, we need to
|
# to check. as ansible_version does not provide major.minor in dict, we need to
|
||||||
# set it as variable.
|
# set it as variable.
|
||||||
- name: Checking Ansible version
|
- name: Checking Ansible version
|
||||||
vars:
|
assert:
|
||||||
ansible_version_host: "{{ ansible_version.major }}.{{ ansible_version.minor }}"
|
that:
|
||||||
fail:
|
- ansible_version_host is version(ansible_version_min, '>=')
|
||||||
msg: >-
|
- ansible_version_host is version(ansible_version_max, '<=')
|
||||||
|
fail_msg: >-
|
||||||
Ansible version should be between {{ ansible_version_min }} and {{ ansible_version_max }}.
|
Ansible version should be between {{ ansible_version_min }} and {{ ansible_version_max }}.
|
||||||
Current version is {{ ansible_version.full }} which is not supported.
|
Current version is {{ ansible_version.full }} which is not supported.
|
||||||
|
vars:
|
||||||
|
ansible_version_host: "{{ ansible_version.major }}.{{ ansible_version.minor }}"
|
||||||
run_once: true
|
run_once: true
|
||||||
when: ansible_version_host is version(ansible_version_min, '<') or ansible_version_host is version(ansible_version_max, '>')
|
|
||||||
|
Loading…
Reference in New Issue
Block a user