From e4dee56c4454e88c27fd8a294c592d40ca7717ad Mon Sep 17 00:00:00 2001 From: ameera Date: Tue, 3 Nov 2026 09:57:41 +0200 Subject: [PATCH 1/2] CI: run sanity tests on ansible-core 2.15 to 2.22 and devel Sanity was tested only on ansible-core 2.15 and 2.16, which are end of life, while the collection declares requires_ansible >= 2.15.0. - Test every stable branch from 2.15 to 2.22, each installed on a Python version that ansible-core release supports (2.18 and later no longer install on Python 3.10). - Test devel as an early warning; a devel failure does not fail the run. - Disable fail-fast, so a failure on one version does not cancel the others. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ansible-test.yml | 33 ++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml index d1cfc14..59a4d96 100644 --- a/.github/workflows/ansible-test.yml +++ b/.github/workflows/ansible-test.yml @@ -25,12 +25,33 @@ jobs: sanity: name: Sanity (Ⓐ${{ matrix.ansible }}) strategy: + # run every ansible-core version even if one of them fails + fail-fast: false matrix: - ansible: - # It's important that Sanity is tested against all stable-X.Y branches - # Testing against `devel` may fail as new tests are added. - - stable-2.15 - - stable-2.16 + # It's important that Sanity is tested against all stable-X.Y branches + # Testing against `devel` may fail as new tests are added. + # python is the controller version used to install that ansible-core version + include: + - ansible: stable-2.15 + python: '3.11' + - ansible: stable-2.16 + python: '3.12' + - ansible: stable-2.17 + python: '3.12' + - ansible: stable-2.18 + python: '3.13' + - ansible: stable-2.19 + python: '3.13' + - ansible: stable-2.20 + python: '3.13' + - ansible: stable-2.21 + python: '3.13' + - ansible: stable-2.22 + python: '3.13' + - ansible: devel + python: '3.13' + # devel is tested for early warning only, a failure there does not fail the run + continue-on-error: ${{ matrix.ansible == 'devel' }} runs-on: ubuntu-latest steps: @@ -47,7 +68,7 @@ jobs: with: # it is just required to run that once as "ansible-test sanity" in the docker image # will run on all python versions it supports. - python-version: '3.10' + python-version: ${{ matrix.python }} # Install the head of the given branch (devel, stable-2.10) - name: Install ansible-base (${{ matrix.ansible }}) From 0129ceae3287db466371cac25ce2864167845b78 Mon Sep 17 00:00:00 2001 From: ameera Date: Tue, 3 Nov 2026 10:03:48 +0200 Subject: [PATCH 2/2] Fix RETURN docs rejected by validate-modules in ansible-core 2.21 ansible-core 2.21 validate-modules rejects return value keys that cannot be used with dot notation in Jinja (bad-return-value-key). The keys were also not the ones the modules return: - cp_gaia_simulate_packet: the result is returned in simulate_packet, not "packet rulebase execution result". - cp_gaia_vsnext_state_facts: the API response keys are converted to underscores, so the facts are session_virtual_system_id and member_id. - cp_gaia_virtual_systems_facts: document the show-virtual-systems response (objects, from, to, total) instead of the VSNext state facts that were copied from cp_gaia_vsnext_state_facts. Regenerate the docs of the three modules. Co-Authored-By: Claude Opus 5.5 --- docs/cp_gaia_simulate_packet.rst | 2 +- docs/cp_gaia_virtual_systems_facts.rst | 35 ++++++++++++---- docs/cp_gaia_vsnext_state_facts.rst | 4 +- plugins/modules/cp_gaia_simulate_packet.py | 2 +- .../modules/cp_gaia_virtual_systems_facts.py | 41 +++++++++++++++---- plugins/modules/cp_gaia_vsnext_state_facts.py | 4 +- 6 files changed, 66 insertions(+), 22 deletions(-) diff --git a/docs/cp_gaia_simulate_packet.rst b/docs/cp_gaia_simulate_packet.rst index 9027980..86dde25 100644 --- a/docs/cp_gaia_simulate_packet.rst +++ b/docs/cp_gaia_simulate_packet.rst @@ -140,7 +140,7 @@ Examples Return Values ------------- -packet rulebase execution result (always., dict, ) +simulate_packet (always., dict, ) the NAT and Access rulebase execution result. diff --git a/docs/cp_gaia_virtual_systems_facts.rst b/docs/cp_gaia_virtual_systems_facts.rst index d2f0ee7..4597dd1 100644 --- a/docs/cp_gaia_virtual_systems_facts.rst +++ b/docs/cp_gaia_virtual_systems_facts.rst @@ -62,19 +62,40 @@ Return Values ------------- ansible_facts (always., dict, ) - The VSNext state facts. + The Virtual Systems facts. - enabled (always, bool, ) - The VSNext state. + objects (always, list, ) + List of configured Virtual Systems. - session-virtual-system-id (always, int, ) - The Virtual System ID of the current Gaia API session. + id (always, int, ) + Virtual System ID. - member-id (On Scalable and Elastic XL platforms only., int, ) - The member on which the command was executed. + name (always, str, ) + Virtual System name. + + + virtual_system_type (always, str, ) + Virtual System type, Gateway or Switch. + + + interfaces (always, list, ) + Network interfaces attached to the Virtual System. + + + + from (always, int, ) + From which element number the query was done. + + + to (always, int, ) + To which element number the query was done. + + + total (always, int, ) + Total number of elements returned by the query. diff --git a/docs/cp_gaia_vsnext_state_facts.rst b/docs/cp_gaia_vsnext_state_facts.rst index c12528f..6207fcc 100644 --- a/docs/cp_gaia_vsnext_state_facts.rst +++ b/docs/cp_gaia_vsnext_state_facts.rst @@ -69,11 +69,11 @@ ansible_facts (always., dict, ) The VSNext state. - session-virtual-system-id (always, int, ) + session_virtual_system_id (always, int, ) The Virtual System ID of the current Gaia API session. - member-id (On Scalable and Elastic XL platforms only., int, ) + member_id (On Scalable and Elastic XL platforms only., int, ) The member on which the command was executed. diff --git a/plugins/modules/cp_gaia_simulate_packet.py b/plugins/modules/cp_gaia_simulate_packet.py index c1c034b..af2c1fb 100644 --- a/plugins/modules/cp_gaia_simulate_packet.py +++ b/plugins/modules/cp_gaia_simulate_packet.py @@ -138,7 +138,7 @@ """ RETURN = """ -packet rulebase execution result: +simulate_packet: description: the NAT and Access rulebase execution result. returned: always. type: dict diff --git a/plugins/modules/cp_gaia_virtual_systems_facts.py b/plugins/modules/cp_gaia_virtual_systems_facts.py index e1849c6..9df084e 100644 --- a/plugins/modules/cp_gaia_virtual_systems_facts.py +++ b/plugins/modules/cp_gaia_virtual_systems_facts.py @@ -51,21 +51,44 @@ RETURN = """ ansible_facts: - description: The VSNext state facts. + description: The Virtual Systems facts. returned: always. type: dict contains: - enabled: - description: The VSNext state. + objects: + description: List of configured Virtual Systems. returned: always - type: bool - session-virtual-system-id: - description: The Virtual System ID of the current Gaia API session. + type: list + elements: dict + contains: + id: + description: Virtual System ID. + returned: always + type: int + name: + description: Virtual System name. + returned: always + type: str + virtual_system_type: + description: Virtual System type, Gateway or Switch. + returned: always + type: str + interfaces: + description: Network interfaces attached to the Virtual System. + returned: always + type: list + elements: str + from: + description: From which element number the query was done. returned: always type: int - member-id: - description: The member on which the command was executed. - returned: On Scalable and Elastic XL platforms only. + to: + description: To which element number the query was done. + returned: always + type: int + total: + description: Total number of elements returned by the query. + returned: always type: int """ diff --git a/plugins/modules/cp_gaia_vsnext_state_facts.py b/plugins/modules/cp_gaia_vsnext_state_facts.py index 4ff38a7..770f6e0 100644 --- a/plugins/modules/cp_gaia_vsnext_state_facts.py +++ b/plugins/modules/cp_gaia_vsnext_state_facts.py @@ -57,11 +57,11 @@ description: The VSNext state. returned: always type: bool - session-virtual-system-id: + session_virtual_system_id: description: The Virtual System ID of the current Gaia API session. returned: always type: int - member-id: + member_id: description: The member on which the command was executed. returned: On Scalable and Elastic XL platforms only. type: int