2020-04-22 20:33:44 +00:00
|
|
|
---
|
|
|
|
- hosts: localhost
|
|
|
|
gather_facts: false
|
|
|
|
become: no
|
|
|
|
vars:
|
2021-01-11 15:49:11 +00:00
|
|
|
minimal_ansible_version: 2.9.0
|
2021-07-12 07:00:47 +00:00
|
|
|
minimal_ansible_version_2_10: 2.10.11
|
2021-11-11 00:11:50 +00:00
|
|
|
maximal_ansible_version: 2.12.0
|
2020-04-22 20:33:44 +00:00
|
|
|
ansible_connection: local
|
2021-08-25 19:01:54 +00:00
|
|
|
tags: always
|
2020-04-22 20:33:44 +00:00
|
|
|
tasks:
|
2021-01-11 15:49:11 +00:00
|
|
|
- name: "Check {{ minimal_ansible_version }} <= Ansible version < {{ maximal_ansible_version }}"
|
2020-04-22 20:33:44 +00:00
|
|
|
assert:
|
2021-01-11 15:49:11 +00:00
|
|
|
msg: "Ansible must be between {{ minimal_ansible_version }} and {{ maximal_ansible_version }}"
|
2020-04-22 20:33:44 +00:00
|
|
|
that:
|
|
|
|
- ansible_version.string is version(minimal_ansible_version, ">=")
|
2021-01-11 15:49:11 +00:00
|
|
|
- ansible_version.string is version(maximal_ansible_version, "<")
|
2020-04-22 20:33:44 +00:00
|
|
|
tags:
|
|
|
|
- check
|
2021-04-13 07:43:01 +00:00
|
|
|
|
2021-07-12 07:00:47 +00:00
|
|
|
- name: "Check Ansible version > {{ minimal_ansible_version_2_10 }} when using ansible 2.10"
|
|
|
|
assert:
|
|
|
|
msg: "When using Ansible 2.10, the minimum supported version is {{ minimal_ansible_version_2_10 }}"
|
|
|
|
that:
|
|
|
|
- ansible_version.string is version(minimal_ansible_version_2_10, ">=")
|
|
|
|
- ansible_version.string is version(maximal_ansible_version, "<")
|
|
|
|
when:
|
|
|
|
- ansible_version.string is version('2.10.0', ">=")
|
|
|
|
tags:
|
|
|
|
- check
|
|
|
|
|
2021-04-13 07:43:01 +00:00
|
|
|
- name: "Check that python netaddr is installed"
|
|
|
|
assert:
|
|
|
|
msg: "Python netaddr is not present"
|
|
|
|
that: "'127.0.0.1' | ipaddr"
|
|
|
|
tags:
|
|
|
|
- check
|
|
|
|
|
|
|
|
# CentOS 7 provides too old jinja version
|
|
|
|
- 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
|