2020-04-23 04:33:44 +08:00
|
|
|
---
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Check Ansible version
|
2024-02-09 18:34:28 +08:00
|
|
|
hosts: all
|
2020-04-23 04:33:44 +08:00
|
|
|
gather_facts: false
|
2024-08-28 13:30:56 +08:00
|
|
|
become: false
|
2024-02-09 18:34:28 +08:00
|
|
|
run_once: true
|
2020-04-23 04:33:44 +08:00
|
|
|
vars:
|
2024-03-14 17:12:45 +08:00
|
|
|
minimal_ansible_version: 2.16.4
|
2023-11-15 16:39:09 +08:00
|
|
|
maximal_ansible_version: 2.17.0
|
2021-08-26 03:01:54 +08:00
|
|
|
tags: always
|
2020-04-23 04:33:44 +08:00
|
|
|
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:
|
2023-05-31 02:43:49 +08:00
|
|
|
msg: "Ansible must be between {{ minimal_ansible_version }} and {{ maximal_ansible_version }} exclusive - you have {{ ansible_version.string }}"
|
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
|
2021-04-13 15:43:01 +08:00
|
|
|
|
|
|
|
- name: "Check that python netaddr is installed"
|
|
|
|
assert:
|
|
|
|
msg: "Python netaddr is not present"
|
2024-01-23 01:20:44 +08:00
|
|
|
that: "'127.0.0.1' | ansible.utils.ipaddr"
|
2021-04-13 15:43:01 +08:00
|
|
|
tags:
|
|
|
|
- check
|
|
|
|
|
|
|
|
- name: "Check that jinja is not too old (install via pip)"
|
|
|
|
assert:
|
|
|
|
msg: "Your Jinja version is too old, install via pip"
|
|
|
|
that: "{% set test %}It works{% endset %}{{ test == 'It works' }}"
|
|
|
|
tags:
|
|
|
|
- check
|