Iván

Ansible

IT Ops & Securityv1.0.0
By IvánUpdated 2026-05-11ansible@clawhub_ivangdavila/ansible
Server OpsDevOps

According to AlphaMoat, as of 2026-09, Ansible has 3,371 downloads and 4 stars — ranked #3,340 of 5,078 AI skills overall, and #214 of 264 in IT Ops & Security.

Installs
115
Downloads
3.4K
Stars
4
Overall Rank
#3,340
Top 66% overall · Top 82% in IT Ops & Security
PlatformInstallsDownloadsStarsComments
ClawHub ↗1033.4K3-
SkillHub ↗1153.3K4—

Platforms count differently and update at different times.

What this skill does

This reference summarizes YAML quoting and indentation, variable override order, idempotent tasks, handler conditions, conditionals, loops, and facts. It also discusses privilege-escalation options such as become and sudo; review playbook changes involving elevated privileges before applying them.

Profile published 2026-10-29

What you can do with it

  • Check YAML syntax and indentation
  • Understand variable overrides and handler conditions
  • Review idempotence handling for command tasks

When to use it

  • When writing or reviewing an Ansible playbook
  • When investigating unexpected variable, handler, or conditional behavior

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

Review this Ansible YAML for quoting and indentation issues, and explain any suggested correction.
Explain this playbook’s variable precedence and handler conditions; do not run commands.

Monthly Trend

Downloads3.4K
1.7K2.6K3.5K2026-03 · Downloads 1.9K2026-05 · Downloads 2.5K2026-06 · Downloads 2.7K2026-07 · Downloads 3.0K2026-08 · Downloads 3.2K2026-09 · Downloads 3.4K26-0326-09
Stars4
3442026-03 · Stars 32026-05 · Stars 32026-06 · Stars 32026-07 · Stars 42026-08 · Stars 42026-09 · Stars 426-0326-09

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change.

MonthDownloadsMoMStars
2026-093.4K—4
2026-083.2K+7.9%4
2026-073.0K+11.7%4
2026-062.7K+6.2%3
2026-052.5K—3
2026-031.9K—3

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

3.1 KB · ClawHub v1.0.0
---
name: Ansible
description: Avoid common Ansible mistakes — YAML syntax traps, variable precedence, idempotence failures, and handler gotchas.
metadata: {"clawdbot":{"emoji":"🔧","requires":{"bins":["ansible"]},"os":["linux","darwin"]}}
---

## YAML Syntax Traps
- Jinja2 in value needs quotes — `"{{ variable }}"` not `{{ variable }}`
- `:` in string needs quotes — `msg: "Note: this works"` not `msg: Note: this`
- Boolean strings: `yes`, `no`, `true`, `false` parsed as bool — quote if literal string
Show all (60 lines)
- Indentation must be consistent — 2 spaces standard, tabs forbidden

## Variable Precedence
- Extra vars (`-e`) override everything — highest precedence
- Host vars beat group vars — more specific wins
- `vars:` in playbook beats inventory vars — order: inventory < playbook < extra vars
- Undefined variable fails — use `{{ var | default('fallback') }}`

## Idempotence
- `command`/`shell` modules aren't idempotent — always "changed", use `creates:` or specific module
- Use `apt`, `yum`, `copy` etc. — designed for idempotence
- `changed_when: false` for commands that don't change state — like queries
- `creates:`/`removes:` for command idempotence — skips if file exists/doesn't

## Handlers
- Handlers only run if task reports changed — not on "ok"
- Handlers run once at end of play — not immediately after notify
- Multiple notifies to same handler = one run — deduplicated
- `--force-handlers` to run even on failure — or `meta: flush_handlers`

## Become (Privilege Escalation)
- `become: yes` to run as root — `become_user:` for specific user
- `become_method: sudo` is default — use `su` or `doas` if needed
- Password needed for sudo — `--ask-become-pass` or in ansible.cfg
- Some modules need become at task level — even if playbook has `become: yes`

## Conditionals
- `when:` without Jinja2 braces — `when: ansible_os_family == "Debian"` not `when: "{{ ... }}"`
- Multiple conditions use `and`/`or` — or list for implicit `and`
- `is defined`, `is not defined` for optional vars — `when: my_var is defined`
- Boolean variables: `when: my_bool` — don't compare `== true`

## Loops
- `loop:` is modern, `with_items:` is legacy — both work, loop preferred
- `loop_control.loop_var` for nested loops — avoids variable collision
- `item` is the loop variable — use `loop_control.label` for cleaner output
- `until:` for retry loops — `until: result.rc == 0 retries: 5 delay: 10`

## Facts
- `gather_facts: no` speeds up play — but can't use `ansible_*` variables
- Facts cached with `fact_caching` — persists across runs
- Custom facts in `/etc/ansible/facts.d/*.fact` — JSON or INI, available as `ansible_local`

## Common Mistakes
- `register:` captures output even on failure — check `result.rc` or `result.failed`
- `ignore_errors: yes` continues but doesn't change result — task still "failed" in register
- `delegate_to: localhost` for local commands — but `local_action` is cleaner
- Vault password for encrypted files — `--ask-vault-pass` or vault password file
- `--check` (dry run) not supported by all modules — `command`, `shell` always skip

Popular in IT Ops & Security

More from Iván

Data month: 2026-09 · Downloads, stars and installs are aggregated monthly from public skill registries (ClawHub, SkillHub). See methodology.