2020-04-23 04:33:44 +08:00
|
|
|
---
|
|
|
|
- hosts: localhost
|
|
|
|
gather_facts: false
|
|
|
|
become: no
|
|
|
|
vars:
|
2021-01-11 23:49:11 +08:00
|
|
|
minimal_ansible_version: 2.9.0
|
|
|
|
maximal_ansible_version: 2.10.0
|
2020-04-23 04:33:44 +08:00
|
|
|
ansible_connection: local
|
|
|
|
tasks:
|
2021-01-11 23:49:11 +08:00
|
|
|
- name: "Check {{ minimal_ansible_version }} <= Ansible version < {{ maximal_ansible_version }}"
|
2020-04-23 04:33:44 +08:00
|
|
|
assert:
|
2021-01-11 23:49:11 +08:00
|
|
|
msg: "Ansible must be between {{ minimal_ansible_version }} and {{ maximal_ansible_version }}"
|
2020-04-23 04:33:44 +08:00
|
|
|
that:
|
|
|
|
- ansible_version.string is version(minimal_ansible_version, ">=")
|
2021-01-11 23:49:11 +08:00
|
|
|
- ansible_version.string is version(maximal_ansible_version, "<")
|
2020-04-23 04:33:44 +08:00
|
|
|
tags:
|
|
|
|
- check
|