Repository navigation
Add 'validate' regex support for vars_prompt - #85368
bhowmickkrishnendu wants to merge 4 commits into
Conversation
|
The test |
|
@bhowmickkrishnendu why are you pining me in this PR? |
Hi @felixfontein , apologies for tagging you directly — I wasn’t aware of the review workflow in the Ansible community and was just trying to request feedback from someone experienced. Thank you for pointing it out! I’ll follow the standard process and wait for maintainers or codeowners to review this PR. Appreciate your time and support! |
|
The core team usually goes through all (new) PRs once or twice a week, I think, but usually not on weekends. |
Thanks for the clarification, @felixfontein — that’s really helpful. I’ll wait patiently for the core team to review it during the usual cycle. Appreciate your time! |
|
how would this interact with overriding extra vars? also, using assert/fail seems like a more complete solution |
Thanks @bcoca — excellent points! I tested the behavior with Regarding I’ll push a patch shortly with the fix for |
|
@bcoca Thanks for the suggestion! Now validation also applies to values passed via --extra-vars or other sources. If the input doesn't match the validate: regex, it raises an error and avoids prompting. |
Signed-off-by: root <root@my-multipurpose-srv.subnet12291634.vcn12291634.oraclevcn.com>
Signed-off-by: root <root@my-multipurpose-srv.subnet12291634.vcn12291634.oraclevcn.com>
455423c to
c6d900b
Compare
|
Rebased with latest devel to keep CI up-to-date. Looking forward to review feedback! |
|
All requested changes are now complete, and I've added the changelog fragment as per the contribution guidelines. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Hi team 👋 Just checking in — it’s been a couple of weeks since |
Summary
This PR adds support for a new
validatekey invars_prompt, allowing regex-based input validation directly in playbooks.Feature
Example usage:
If the user input does not match the regex, they are prompted again until the input is valid.
Changes Made
Notes
Backward compatible: no changes to existing behavior unless validate is explicitly used.
Useful for enforcing specific input formats (e.g., phone numbers, IPs, usernames).
ISSUE TYPE