Skip to content

[stable-2.7] [backport] Add inventory aap_ca_bundle for Gateway TLS verification - #250

Open
TheNova22 wants to merge 2 commits into
ansible:stable-2.7from
TheNova22:backport-ca-bundle
Open

TheNova22 wants to merge 2 commits into
ansible:stable-2.7from
TheNova22:backport-ca-bundle

Conversation

@TheNova22

@TheNova22 TheNova22 commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Following PR is a devel to 2.7 backport of #238 + #241

…2) (ansible#238)

* Add inventory aap_ca_bundle for Gateway TLS verification

Support control-node CA bundle paths via aap_ca_bundle (and aliases) so
installers can slurp trust material from gateway hosts without per-task
environment blocks or system CA store changes. Forward the path to manager
subprocesses as REQUESTS_CA_BUNDLE when validate_certs is enabled.

Related: ANSTRAT-2452
Co-authored-by: Cursor <cursoragent@cursor.com>

* Fix requests_verify property for PlatformService test stubs

Fall back to instance verify_ssl/ca_bundle attributes when config is
absent. Unit tests construct PlatformService via object.__new__ without
GatewayConfig, which caused AttributeError during TLS verify evaluation
and masked failures as invalid except handlers.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Address CodeRabbit review feedback on CA bundle inventory var.

Fix shell-over-task REQUESTS_CA_BUNDLE precedence, strip CA bundle auth params before model init, map CA paths correctly for Ansible Request, restore integration test facts safely, and add unit tests.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Fix ruff format and document aap_ca_bundle auth-only stripping.

Apply ruff formatting to the action plugin unit test and update auth doc fragment to describe _AUTH_PARAMS filtering and REQUESTS_CA_BUNDLE precedence.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Include TLS trust policy in persistent manager identity hash.

ca_bundle and verify_ssl are baked into the manager subprocess at spawn
and were omitted from the socket key, so a later task changing
aap_ca_bundle or aap_validate_certs reused a stale manager.

Related: ANSTRAT-2452
Co-authored-by: Cursor <cursoragent@cursor.com>

* Hash the effective CA bundle in persistent manager identity.

Task-level REQUESTS_CA_BUNDLE outranks inventory aap_ca_bundle at spawn,
so hashing gateway_config.ca_bundle alone still allowed two tasks with
different trust stores to reuse one manager.

Related: ANSTRAT-2452
Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 3a1485e8-8066-40bc-a4e1-4a032920c146

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

CasC Notification

This PR touches areas that may affect the CasC collections (e.g. infra.aap_configuration).

Detected changes in CasC-monitored areas:

  • Action plugin changes: plugins/action/base_action.py
  • Doc fragment changes (may affect auth/connection params): plugins/doc_fragments/auth.py
  • plugin_utils changes (may affect return structure or auth): plugins/plugin_utils/api/v1/token.py plugins/plugin_utils/manager/platform_manager.py plugins/plugin_utils/manager/process_manager.py plugins/plugin_utils/platform/base_client.py plugins/plugin_utils/platform/config.py plugins/plugin_utils/platform/direct_client.py

Please tag the CasC collections team in this PR so they are aware of the change.

This comment is posted automatically and does not block merge.

* [AAP-76998] Add service_cluster outlier detection options

Jewel added split_external_local_origin_errors and consecutive_local_origin_failure
on ServiceCluster. Expose the same options in the collection so completeness CI
passes and playbooks can set them.

Co-authored-by: Cursor <cursoragent@cursor.com>

* [AAP-76998] Omit YAML defaults on service_cluster outlier options

DOCUMENTATION defaults are copied into the action-plugin argspec, so an
omitted option would PATCH true/0 and overwrite a custom cluster value.
Match the rest of this module: no YAML default, gateway default in the
description.

Co-authored-by: Cursor <cursoragent@cursor.com>

* [AAP-76998] Add unit tests for service_cluster outlier local-origin options

Cover create/update field lists, omit-vs-send of False/0, and from_api mapping so the gateway defaults are not patched when the options are unset.

Co-authored-by: Cursor <cursoragent@cursor.com>

* [AAP-76998] Add molecule coverage for service_cluster outlier options

Prove create, idempotency, update, and exists round-trip split/consecutive
values (including 0 and false) through all three connection modes.

Co-authored-by: Cursor <cursoragent@cursor.com>

* [AAP-76998] Fix yamllint on service_cluster molecule tests

Shorten assert fail_msg lines to the 160-char limit and restore the
document-end marker those playbooks require.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown

CasC Notification

This PR touches areas that may affect the CasC collections (e.g. infra.aap_configuration).

Detected changes in CasC-monitored areas:

  • Module changes: plugins/modules/service_cluster.py
  • Action plugin changes: plugins/action/base_action.py
  • Doc fragment changes (may affect auth/connection params): plugins/doc_fragments/auth.py
  • plugin_utils changes (may affect return structure or auth): plugins/plugin_utils/ansible_models/service_cluster.py plugins/plugin_utils/api/v1/service_cluster.py plugins/plugin_utils/api/v1/token.py plugins/plugin_utils/manager/platform_manager.py plugins/plugin_utils/manager/process_manager.py plugins/plugin_utils/platform/base_client.py plugins/plugin_utils/platform/config.py plugins/plugin_utils/platform/direct_client.py

Please tag the CasC collections team in this PR so they are aware of the change.

This comment is posted automatically and does not block merge.

@github-actions

Copy link
Copy Markdown

DVCS PR Check Results:

PR appears valid (JIRA key(s) found)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.7-backport safe to test PR is safe to run integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants