sigridjineth/hello-ansible-skills/ansible-convert
Claude Code and agent skill by sigridjineth/hello-ansible-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when converting shell scripts to Ansible playbooks. Use when migrating bash automation, manual procedures, or Dockerfiles to idempotent Ansible tasks.
Install
npx vskill@latest install sigridjineth/hello-ansible-skills/ansible-convertSKILL.md
Shell to Ansible Conversion
Overview
Shell scripts execute commands imperatively; Ansible declares desired state. Conversion means rethinking operations as state declarations, not translating commands line-by-line. The goal is idempotency: running twice produces identical results.
When to Use
- Converting existing shell scripts to playbooks
- Migrating manual server setup procedures
- Replacing bash automation with Ansible
- Converting Dockerfile RUN commands
Core Principle
Don't wrap shell commands in Ansible's `shell` module. Find the module that achieves the same end state declaratively.
Conversion Table
| Shell Command | Ansible Module | Notes | |
|---|---|---|---|
mkdir -p | ansible.builtin.file | state: directory | |
cp | ansible.builtin.copy | Static files | |
cp with variables | ansible.builtin.template | Use .j2 templates | |
rm -rf | ansible.builtin.file | state: absent | |
ln -s | ansible.builtin.file | state: link | |
chmod, chown | Include in file/copy/template | mode, owner, group params | |
apt-get install | ansible.builtin.apt | update_cache: yes | |
yum install | ansible.builtin.yum | Or use package for cross-platform | |
pip install | ansible.builtin.pip | Specify executable if needed | |
useradd | ansible.builtin.user | Handles home, shell, groups | |
systemctl start | ansible.builtin.service | state: started | |
systemctl enable | ansible.builtin.service | enabled: yes | |
curl -O | ansible.builtin.get_url | Use checksum for verification | |
tar -xzf | ansible.builtin.unarchive | remote_src: yes if already on target | |
echo >> file | ansible.builtin.lineinfile | Ensures line exists | |
cat > file | ansible.builtin.copy | content: parameter |
Control Flow Conversion
Conditionals
Loops
When Shell Module is Necessary
Use command or shell only when no module exists. Always add proper change detection:
Variable Extraction
Identify values to parameterize:
- Version numbers →
app_version: "1.2.3" - Paths →
app_dir: "/opt/app" - Usernames →
app_user: "appuser" - Ports →
app_port: 8080
Place in defaults/main.yml for easy override.
Conversion Workflow
- Read entire script, identify major phases
- Map each command to Ansible module
- Extract hardcoded values as variables
- Order tasks for dependencies (dirs before files)
- Add handlers for service restarts
- Test with
--check --diff - Verify idempotency: second run shows no changes
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/ansible-convert/SKILL.md
Popularity
- Repository stars
- 33
- Repository forks
- 4
- 7-day trend score
- 18
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 24 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/sigridjineth/hello-ansible-skills/ansible-convert)