Ansible Playbook taste — ChatGPT prompt: what it does, how to install
Ansible Playbook taste — a prompt for ChatGPT, Claude.ai, and Claude Code setting standards for infrastructure code. It aligns Ansible roles with best practices and ensures task idempotency.
CC0-1.0 ★ 178,201 updated 2026-10-24
Open on GitHubWhat Ansible Playbook taste does
This prompt configures the AI to write infrastructure code following pragmatic engineering standards. It mandates organizing work into roles with clear defaults while keeping playbooks concise. The instructions require using fully qualified collection names to prevent module ambiguity and pinning dependency versions in requirements.yml.
The prompt enforces idempotency so repeated runs do not alter system state unnecessarily. It covers secret management via Ansible Vault, using handlers for service restarts, and testing roles with Molecule.
What it helps with
- Standardize Ansible roles across projects
- Ensure task idempotency in playbooks
- Implement secure secret management
- Automate code validation in CI pipelines
Example prompts for the agent
- Review my playbook against the Ansible Playbook taste standards
- Refactor this code using the Ansible Playbook taste guidelines
How to install Ansible Playbook taste
How to use
Paste the text at the start of a chat or into project instructions
Manually: put the files in place
.claude/commands/prompts.csv.mdQuestions about Ansible Playbook taste
What does Ansible Playbook taste do?
It provides a set of instructions for AI to write clean, maintainable Ansible code.
How to install Ansible Playbook taste in Claude Code?
Copy the prompt content into the .claude/commands/prompts.csv.md file in your project root.
What is required to use this prompt?
Basic knowledge of Ansible and access to ChatGPT, Claude.ai, or Claude Code.
Source text
prompts.csv · CC0-1.0
# Ansible Playbook taste of a pragmatic infrastructure engineer - Organize work into roles with clear defaults, and keep playbooks thin, mostly a list of roles applied to host groups. Confidence: 0.90 - Use fully qualified collection names like ansible.builtin.copy in every task so modules are never ambiguous. Confidence: 0.85 - Pin collection and role versions in a requirements.yml file and install them in CI from that file only. Confidence: 0.90 - Write every task to be idempotent, so a second run reports zero changes on a converged host. Confidence: 0.95 - Prefer purpose-built modules over shell or command; when shell is unavoidable, set creates, removes or changed_when explicitly. Confidence: 0.90 - Give every task a clear, human-readable name that says what state it ensures, not which command it runs. Confidence: 0.80 - Keep variables in group_vars and host_vars, and avoid setting the same variable in more than two places. Confidence: 0.85 - Prefix role variables with the role name, such as nginx_worker_processes, to avoid collisions between roles. Confidence: 0.85 - Store secrets in Ansible Vault or an external secret manager lookup, and never commit them in plain text. Confidence: 0.95 - Use handlers for service restarts so services restart once at the end, only when their configuration actually changed. Confidence: 0.90 - Template configuration files with Jinja2 and validate them before replacing, using the validate option where the service supports it. Confidence: 0.85 - Run ansible-lint and yamllint in CI on every pull request. Confidence: 0.85 - Test roles with Molecule against disposable containers or VMs for each supported operating system. Confidence: 0.75 - Use --check and --diff before applying changes to production, and review the diff like a code change. Confidence: 0.85 - Roll out to production with serial batches and max_fail_percentage so a bad change stops before it reaches every host. Confidence: 0.85 - Keep a dynamic inventory from the cloud provider or CMDB instead of hand-edited host lists. Confidence: 0.75 - Use tags sparingly and consistently, mainly to run one role or one concern, not to build hidden execution paths. Confidence: 0.70 - Avoid ignore_errors; use failed_when with a precise condition or a block with rescue when failure is expected. Confidence: 0.85 - Set become only on the tasks that need root, not globally for the whole play. Confidence: 0.75 - Enable SSH pipelining and tune forks to cut run time, and measure with the profile_tasks callback before optimizing further. Confidence: 0.70 - Run playbooks from CI or a controlled runner such as AWX, not from personal laptops, so every change is logged. Confidence: 0.80
© f · CC0-1.0 · f/prompts.chat