- How you use it
- You paste it when you need it
- What it can do
- writes files; Shell and network instructions not verified; read the prompt text before running it.
- What's inside
The option
| Option | APrompt · v1.0.0Ansible repair review prompt |
|---|---|
| How you use it | You paste it when you need it |
| What it can do | writes files; Shell and network instructions not verified; read the prompt text before running it. |
| What's inside |
What this thread does
Do first: In the existing Ansible environment, run ansible-lint.
Run ansible-lint first, exercise an explicit Molecule scenario on disposable hosts, then use check mode against a narrowly limited inventory before approving a real playbook run.
Build an agent repair loop
1. Give the agent the role or playbook, its inventory contract, required collections and the operating systems it must support. Ask for a test scenario with real create, converge, verify and destroy playbooks; inspect those targets before execution. 2. Start with the existing Ansible environment and run:
ansible-lint
Have the agent fix the reported rule, not add blanket exclusions. The Ansible Lint usage guide describes profiles and rule selection. Treat dependency setup as separate preparation, not evidence that a playbook works. 3. In the configured disposable scenario, run:
molecule test
Review the configured sequence rather than assuming the command includes every desired check. Require convergence, assertions about resulting service or file state, a second convergence that reports no changes, and cleanup. The current Molecule workflow reference supports explicit sequences; a scenario that merely creates and destroys hosts does not verify your role. Use the current Ansible-native configuration instead of copying old driver examples. 4. Run a check-mode pass only after inspecting tasks and the inventory. In this example, review-host must be a disposable host in inventory.ini:
ansible-playbook -i inventory.ini site.yml --check --diff --limit review-host
Inspect every task with check_mode: false before doing this: it can run normally even under --check. Modules without check-mode support can be skipped, and registered-variable conditions can behave differently. Diff output can expose sensitive file contents; suppress it for those tasks. Ansible check and diff documentation. 5. Return failures and the smallest relevant task context to the agent. Rerun the failing layer after each repair. Keep real inventory execution as a separately approved operation.
Diagnostic: a second converge still reports changes
Reproduce by running molecule converge twice and inspect the second recap. The Molecule FAQ says idempotence follows Ansible's own changed reporting. Check unconditional commands, timestamps, handlers and actual state. Do not set changed_when: false merely to hide a real repeated action.
Public evidence
In Molecule issue 4414, Perdu reports that a failing handler was attributed to the notifying task: “instead of the handler itself.” That historical reproduction supports inspecting handler output as well as the named task. It does not establish that the same diagnostic defect affects the current stable release.
Prompt for the agent
Add assertions that would fail if the intended service or configuration were absent. Show the scenario sequence and all target hosts. Fix lint and convergence failures without hiding changed results or skipping verification. Stop before any production inventory run, and list tasks that may behave differently in check mode.
Versions and limits
Sources checked 2026-11-17. As of November 2026, releases fetched are ansible-core 2.22.0, ansible-lint 26.11.0 and Molecule 26.11.0. These independently current versions are not a tested compatibility matrix. Confirm Python, collection and target-platform requirements in your environment. Test on the target host type; do not assume container tests establish target-host behavior. No live host test or end-to-end run of this combination is claimed; no generic scenario package is offered without a concrete role and host lifecycle.
Started from a post by @Ansible project, packaged by the editor. Original post
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.