Cap the ansible version used by ansible-lint

the openvswitch.openvswitch collection is removed from Ansible packages
starting with Ansible 11. This causes ansible-lint to correctly not find
the openvswitch_bridge module when ansible-lint runs with Ansible 11.
Workaround this by capping Ansible used by ansible-lint to <10 and leave
a note about the module going away where we use it.

Change-Id: Id2d4e4f59c7d7e595c5458bc8717146c2326c573
This commit is contained in:
Clark Boylan 2024-11-19 14:09:13 -08:00
parent d2d25cd9ec
commit 7682f2fb5b
4 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,6 @@
# linters have different requirements than test ones, some would
# conflict, like ansible version required by ansible-lint.
ansible>=2.12.0 # required by ansible-lint
ansible>=2.12.0,<10 # required by ansible-lint
flake8
yamllint>=1.23.0
# 6.5.0 : https://github.com/ansible/ansible-lint/issues/2330

View File

@ -47,6 +47,7 @@
- name: Create bridge on peer node
become: yes
# TODO Ansible 11 removes this module
openvswitch_bridge:
bridge: "{{ bridge_name }}"

View File

@ -1,5 +1,6 @@
- name: Ensure the bridge exists
become: yes
# TODO Ansible 11 removes this module
openvswitch_bridge:
bridge: "{{ bridge_name }}"

View File

@ -22,6 +22,7 @@
register: ovs_running
- name: bridge should exist
# TODO this ansible collection and module are removed in Ansible 11
openvswitch_bridge:
bridge: "{{ bridge_name }}"
register: ovs_bridge