agentleFS
abdullahkhawerabdullahkhawer/devops-skills/skills/ansible-cli/SKILL.md

ansible-cli

Skill8 starsChanged 7 months agoApache-2.0View on GitHub

Perform Ansible operations using ansible and ansible-playbook. Use for running playbooks, checking inventory, and validating configuration against target environments.

  • Installs packages

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 4 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the inventory table and rules below when constructing all ansible/ansible-playbook commands.

    line 8
  2. Distinctive:

    Update the table below with your inventory file paths before using this skill:

    line 12
  3. Distinctive:

    If the target environment is unclear, ask the user before running any command.

    line 19
  4. Very specific:

    If ansible is not installed or no inventory is configured, inform the user that setup is required and ask them to complete the following …

    line 23
  5. Very specific:

    Always pass -i <inventory-file> explicitly — never rely on a default inventory:

    line 32
  6. Distinctive:

    NEVER target an inventory file not listed in the configuration table above.

    line 83
  7. Very specific:

    Always pass -i <inventory-file> explicitly on every command — never rely on ansible.cfg defaults, which may silently target the wrong hosts.

    line 84
  8. Very specific:

    Always run with --check --diff first and show the output before ever suggesting a real run — never apply blind, especially against …

    line 85
  9. Distinctive:

    NEVER run a playbook or ad-hoc command against a production inventory without explicit user instruction.

    line 86
  10. Very specific:

    NEVER print, display, or store the contents of ansible-vault-encrypted files or vault password files — treat them as credentials.

    line 87
  11. Very specific:

    If a host group or variable name is unfamiliar, inspect it with ansible-inventory first.

    line 88
  12. Very specific:

    Prefer idempotent modules.

    line 89

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Ansible CLI Skill

Use the inventory table and rules below when constructing all ansible/ansible-playbook commands.

Configuration

Update the table below with your inventory file paths before using this skill:

EnvironmentInventory FileVault Password File
Production<your-prod-inventory><your-prod-vault-pass-file>
Staging / Non-Prod<your-nonprod-inventory><your-nonprod-vault-pass-file>

If the target environment is unclear, ask the user before running any command.

Prerequisites (one-time setup by user)

If ansible is not installed or no inventory is configured, inform the user that setup is required and ask them to complete the following steps manually. Do not perform these steps yourself.

brew install ansible
ansible-inventory -i <inventory-file> --list

Command Format

Always pass -i <inventory-file> explicitly — never rely on a default inventory:

ansible-playbook -i <inventory-file> <playbook.yml> [options]

Examples

# Dry run against non-prod
ansible-playbook -i <your-nonprod-inventory> <playbook.yml> --check --diff

# List hosts targeted by a play
ansible-playbook -i <your-nonprod-inventory> <playbook.yml> --list-hosts

Available Commands

Read-only (safe, no confirmation needed)

CommandDescription
ansible-inventory -i <inv> --list/--graphShow inventory structure
ansible <group> -i <inv> -m pingCheck host connectivity (no state change)
ansible <group> -i <inv> -m setupGather facts about hosts
ansible-playbook -i <inv> <playbook> --check --diffDry-run a playbook, showing what would change
ansible-playbook -i <inv> <playbook> --list-hostsList hosts a playbook would target
ansible-playbook -i <inv> <playbook> --list-tasksList tasks a playbook would run
ansible-lint <playbook>Lint a playbook for issues
ansible-doc <module>Show documentation for a module
ansible-vault view <file>View encrypted vault contents (still a credential — handle per Rules)

Mutating operations (confirm with user before running)

CommandDescription
ansible-playbook -i <inv> <playbook>Run a playbook, applying real changes to target hosts
ansible <group> -i <inv> -m <module> -a "<args>"Run an ad-hoc module against hosts
ansible-vault encrypt/decrypt <file>Encrypt or decrypt a vault file

Never run — requires explicit human approval

CommandReason
ansible-playbook -i <inv> <playbook> against production inventoryMutates live production infrastructure
ansible <group> -m reboot/shutdownDisrupts running workloads
ansible <group> -m service -a "state=stopped"Stops services on live hosts
ansible-playbook --force-handlers combined with destructive tasksForces handlers to run even after failures, bypassing safety checks

Rules

  • NEVER target an inventory file not listed in the configuration table above. If a command references an unfamiliar inventory, stop and ask the user to confirm.
  • Always pass -i <inventory-file> explicitly on every command — never rely on ansible.cfg defaults, which may silently target the wrong hosts.
  • Always run with --check --diff first and show the output before ever suggesting a real run — never apply blind, especially against production.
  • NEVER run a playbook or ad-hoc command against a production inventory without explicit user instruction.
  • NEVER print, display, or store the contents of ansible-vault-encrypted files or vault password files — treat them as credentials.
  • If a host group or variable name is unfamiliar, inspect it with ansible-inventory first.
  • Prefer idempotent modules; flag any shell/command module usage that could be replaced with a dedicated idempotent module.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.