cd7381d8de
Ansible v2.9 and v2.10 are EOL as [1]. This drops those version supports by following the upstream Ansible. This sets use_ssh_args true always because that is required to use ssh_args on ansible.cfg on Ansible v2.11 or later[2]. ansible_ssh_host is replaced with ansible_host because ansible_ssh_host has been deprecated already and cenots7 jobs were failed due to the deprecated ansible_ssh_host. [1]: https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html#ansible-core-changelogs [2]: https://docs.ansible.com/ansible/latest/collections/ansible/posix/synchronize_module.html#parameter-use_ssh_args
33 lines
1 KiB
YAML
33 lines
1 KiB
YAML
---
|
|
- hosts: localhost
|
|
gather_facts: false
|
|
become: no
|
|
vars:
|
|
minimal_ansible_version: 2.11.0
|
|
maximal_ansible_version: 2.13.0
|
|
ansible_connection: local
|
|
tags: always
|
|
tasks:
|
|
- name: "Check {{ minimal_ansible_version }} <= Ansible version < {{ maximal_ansible_version }}"
|
|
assert:
|
|
msg: "Ansible must be between {{ minimal_ansible_version }} and {{ maximal_ansible_version }}"
|
|
that:
|
|
- ansible_version.string is version(minimal_ansible_version, ">=")
|
|
- ansible_version.string is version(maximal_ansible_version, "<")
|
|
tags:
|
|
- check
|
|
|
|
- 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
|