fix: detect missing cryptography/SECP384R1 before deployment starts#14970
Merged
fix: detect missing cryptography/SECP384R1 before deployment starts#14970
Conversation
…ility
Add pre-flight check in main.yml that catches missing cryptography/SECP384R1
before deployment starts, replacing the cryptic error from community.crypto
internals with an actionable message pointing users to run ./algo or uv sync.
Root cause of the CI ipsec/both test failures: cryptography 46.0.5 wraps
the ec module with _ModuleWithDeprecations (for SECT curve deprecation),
which breaks community.crypto's ec.__dict__.get("SECP384R1") lookup.
The fix in community.crypto 3.1.1 uses getattr() instead.
Changes:
- Add SECP384R1 pre-flight check to main.yml (conditional on ipsec_enabled)
- Add cryptography>=42.0.0 as explicit dependency in pyproject.toml
- Upgrade community.crypto to >=3.1.1 (fixes __dict__ vs getattr bug)
- Add ansible-galaxy collection install step to CI
- Use venv Python interpreter for local deployments in add_host tasks
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
67dc048 to
d4d6550
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
main.ymlthat catches missing/broken cryptography before deployment starts, replacing the cryptic community.crypto error with an actionable fix messagecryptography>=42.0.0as explicit dependency inpyproject.tomlcommunity.cryptoto>=3.1.1to fixec.__dict__.get()vsgetattr()bug exposed by cryptography 46.0.5ansible-galaxy collection installstep to CI (was missing, causing CI to use the older bundled collection)add_hosttasksRoot cause analysis
The IPsec CI failures were caused by cryptography 46.0.5 (released 2026-02-11) which wraps the
ecmodule with_ModuleWithDeprecationsfor SECT curve deprecation. This wrapper intercepts__getattr__but doesn't populate__dict__, breakingcommunity.crypto'sec.__dict__.get("SECP384R1")lookup. The fix in community.crypto 3.1.1 (PR #981) switches togetattr().Test plan
ansible-lint .passesyamllint .passespytest tests/unit/ -qpasses🤖 Generated with Claude Code