agentleFS
greedychipmunkgreedychipmunk/agent-skills/ansible/SKILL.md

ansible

Skill19 starsChanged 6 months agoMITView on GitHub

Automate configuration management and application deployment with Ansible. Use when tasks mention ansible-playbook, inventory files, Ansible roles, ad-hoc commands, ansible-galaxy, or agentless SSH automation.

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

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

    Always run with --check --diff first to preview changes without applying them.

    line 58
  2. Very specific:

    Use --limit to target a subset of hosts before running against all inventory.

    line 59
  3. Very specific:

    Avoid command and shell modules when an idempotent module exists.

    line 60
  4. Distinctive:

    Write or update playbook.

    line 74
  5. Very specific:

    Run against a subset: ansible-playbook site.yml -i inventory.ini --limit web1.example.com

    line 76
  6. Very specific:

    Run against all: ansible-playbook site.yml -i inventory.ini

    line 77

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “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

Intent Router

RequestReferenceLoad When
Install tool, SSH setup, ansible.cfgresources/install-and-setup.mdUser needs to install Ansible or configure control node
Inventory files, group_vars, host_varsresources/inventory-and-variables.mdUser needs inventory structure or variable precedence
Playbook authoring, roles, modulesresources/playbook-patterns.mdUser needs play structure, task patterns, or common modules
CLI commands, vault, galaxyresources/command-cookbook.mdUser needs ansible/ansible-playbook/ansible-vault/galaxy commands

Quick Start

# 1. Define your inventory
cat > inventory.ini <<'EOF'
[web]
web1.example.com
web2.example.com

[db]
db1.example.com
EOF

# 2. Test connectivity (ad-hoc ping)
ansible all -i inventory.ini -m ping

# 3. Run a playbook
ansible-playbook -i inventory.ini site.yml

# 4. Dry-run a playbook (check mode — no changes)
ansible-playbook -i inventory.ini site.yml --check --diff

Core Concepts

ConceptDescription
Control nodeMachine where Ansible runs (requires Python; no agent needed on targets)
Managed nodeTarget host reached via SSH (Linux) or WinRM (Windows)
InventoryList of managed nodes (INI, YAML, or dynamic script)
PlaybookYAML file defining ordered plays and tasks
RoleReusable directory structure (tasks, handlers, templates, vars)
ModuleIdempotent unit of work (copy, service, package, user, command…)
CollectionPackaged set of roles, modules, and plugins from Ansible Galaxy

Safety Guardrails

  • Always run with --check --diff first to preview changes without applying them.
  • Use --limit to target a subset of hosts before running against all inventory.
  • Avoid command and shell modules when an idempotent module exists.
  • Running as root (become: true) requires explicit approval — confirm privilege escalation scope.
  • Protect secrets with ansible-vault encrypt — never commit plaintext passwords.
# Install a role then dry-run the playbook to preview changes
ansible-galaxy role install geerlingguy.java
ansible-playbook -i inventory.ini site.yml --check --diff

Workflow

  1. Define or update inventory.
  2. Test connectivity: ansible all -m ping -i inventory.ini
  3. Write or update playbook.
  4. Dry-run: ansible-playbook site.yml -i inventory.ini --check --diff
  5. Run against a subset: ansible-playbook site.yml -i inventory.ini --limit web1.example.com
  6. Run against all: ansible-playbook site.yml -i inventory.ini

Related Skills

  • terraform — provision infrastructure; Ansible configures after provisioning
  • pulumi — IaC with code; Ansible handles post-provision configuration

References

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.