active
AI Ansible Generator
Plain English → validated Ansible playbooks
Turns a plain-English request into an Ansible playbook, then validates YAML, syntax and safety and runs a repair loop until it passes. FastAPI + Gradio, backed by Ollama or Hugging Face models.
- Python
- FastAPI
- Gradio
- Ollama
- Hugging Face
- Ansible
01 problem
Large language models can write Ansible, but raw model output can't be trusted in production: it may not be valid YAML, may not pass Ansible's own syntax checks, and may do something destructive. Pasting it into a terminal is how outages start.
02 approach
- 01 Treat the model as an untrusted author: everything it writes goes through validation before anyone sees it as a result.
- 02 Validate in layers: YAML parsing, Ansible syntax, then safety rules for risky patterns.
- 03 When validation fails, feed the errors back to the model in a repair loop instead of handing the user a broken playbook.
- 04 Keep the model pluggable: run locally with Ollama or use hosted models through Hugging Face.
- 05 Serve it two ways: a FastAPI backend for programmatic use and a Gradio interface for people.
03 architecture
-
01 · request
-
02 · generate
-
03 · validate
-
04 · repair
-
05 · result
trigger · gradio ui · fastapi
plain-English request
A person describes the automation they want in plain English through the Gradio interface, or a client calls the FastAPI backend.
All steps as text
-
1. request
- plain-English request: A person describes the automation they want in plain English through the Gradio interface, or a client calls the FastAPI backend.
-
2. generate
- LLM: The request is turned into a draft playbook by a local model through Ollama or a hosted model through Hugging Face. Either way, the draft is treated as untrusted.
-
3. validate
- YAML check: The draft must parse as YAML before anything else happens.
- syntax check: The playbook must pass Ansible syntax validation.
- safety rules: Safety checks flag dangerous operations before the playbook is returned.
-
4. repair
- repair loop: If any check fails, the validation errors go back to the model with the draft so it can fix them, and the result is validated again.
-
5. result
- validated playbook: Only a playbook that passed every check is returned to the user or API client.
04 outcome
- Plain-English requests become Ansible playbooks that have passed YAML, syntax and safety validation.
- A live demo runs on Hugging Face Spaces.