feat(ansible): add simple pairing flow#1461
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4567ee7777
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const pairConnection = useMutation({ | ||
| mutationFn: () => pairAnsibleModuleConnection({ | ||
| baseUrl: connectionBaseUrl, |
There was a problem hiding this comment.
Keep manual setup for env-managed Ansible tokens
This mutation makes pairing the only connection path in the settings UI, but pairing/claim intentionally rejects Ansible APIs that use ANSIBLE_API_SERVICE_TOKEN_ID/SECRET (the server returns “managed by environment”/409). In that legacy-but-supported mode, admins on a fresh CT-Ops instance now have no way in the UI to enter the static token ID/secret and complete onboarding, so connection setup is blocked entirely.
Useful? React with 👍 / 👎.
| tokenId: input.tokenId, | ||
| tokenSecret: input.tokenSecret, | ||
| tlsMode: inferAnsibleTlsMode(input.baseUrl), | ||
| timeoutMs: ANSIBLE_PAIRING_TIMEOUT_MS, |
There was a problem hiding this comment.
Preserve connection timeout when rotating pairing token
The pairing builder hard-codes timeoutMs to 5000 on every successful pair, so re-pairing silently resets any previously tuned timeout. This can regress existing deployments that raised the timeout for slower links or proxies, because token rotation unexpectedly changes runtime behavior instead of only updating credentials.
Useful? React with 👍 / 👎.
Summary
Validation
Publication follow-up