Files
kubespray/playbooks/ansible_version.yml
ERIK 2dbb33a3d7 build: upgrade to Ansible 14 (#13549)
Raise ansible-core support to 2.21 for maintained upstream support through November 2027. This requires Python 3.12-3.14 on control nodes and 3.9-3.14 on targets.

Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
2026-09-26 15:18:27 +00:00

27 lines
876 B
YAML

---
- name: Check Ansible version
hosts: all
gather_facts: false
become: false
run_once: true
vars:
minimal_ansible_version: 2.21.0
maximal_ansible_version: 2.22.0
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 }} exclusive - you have {{ ansible_version.string }}"
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' | ansible.utils.ipaddr == '127.0.0.1'"
tags:
- check