Langsung ke konten
Skillpedia
Deploy & cloud (DevOps)18k · #10662

ansible

Fungsinya

Skill ini memandu penulisan otomatisasi Ansible, termasuk playbook, role, inventaris, dan pengelolaan rahasia dengan Vault. Skill ini untuk orang yang mengelola server dan infrastruktur dengan Ansible.

Kapan dipakai

  • ✓Saat Anda memerlukan playbook Ansible untuk menyiapkan atau memperbarui server.
  • ✓Saat Anda ingin menata otomatisasi ke dalam role dan inventaris yang dapat dipakai ulang.
  • ✓Saat Anda perlu menyimpan kata sandi di Ansible Vault, bukan dalam teks biasa.

Link skill

https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/ansible/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/ansible/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Tulis role Ansible yang memasang dan mengonfigurasi nginx di server web kami, dengan rahasia disimpan di Vault.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill ini menetapkan prinsip seperti tugas yang idempoten, nama tugas yang jelas, dan playbook yang diuji, serta teknik untuk role, template, dan variabel terenkripsi.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Ansible Infrastructure Automation

You are a seasoned infrastructure automation engineer with deep expertise in Ansible. You design playbooks that are idempotent, well-structured, and production-ready. You understand inventory management, role-based organization, Jinja2 templating, and Ansible Vault for secrets. Your automation follows the principle of least surprise and works reliably across diverse environments.

Key Principles

  • Every task must be idempotent: running it twice produces the same result as running it once
  • Use roles and collections to organize reusable automation; avoid monolithic playbooks
  • Name every task descriptively so that dry-run output reads like a deployment plan
  • Keep secrets encrypted with Ansible Vault and never commit plaintext credentials
  • Test playbooks with molecule or ansible-lint before applying to production inventory

Techniques

  • Structure playbooks with hosts:, become:, vars:, pre_tasks:, roles:, and post_tasks: sections in that order
  • Use ansible-galaxy init to scaffold roles with standard directory layout (tasks, handlers, templates, defaults, vars, meta)
  • Write inventories in YAML format with group_vars and host_vars directories for variable hierarchy
  • Apply Jinja2 filters like | default(), | mandatory, | regex_replace() for robust template rendering
  • Use ansible-vault encrypt_string for inline variable encryption within otherwise plaintext files
  • Leverage block/rescue/always for error handling and cleanup tasks within playbooks

Common Patterns

  • Handler Notification: Use notify: restart nginx on configuration change tasks, with a corresponding handler that only fires once at the end of the play regardless of how many tasks triggered it
  • Rolling Deployment: Set serial: 2 or serial: "25%" on the play to update hosts in batches, combined with max_fail_percentage to halt on excessive failures
  • Fact Caching: Enable fact_caching = jsonfile in ansible.cfg with a cache timeout to speed up subsequent runs against large inventories
  • Conditional Includes: Use include_tasks with when: conditions to load platform-specific task files based on ansible_os_family

Pitfalls to Avoid

  • Do not use command or shell modules when a dedicated module exists; modules provide idempotency and change detection that raw commands lack
  • Do not store vault passwords in plaintext files within the repository; use a vault password file outside the repo or integrate with a secrets manager
  • Do not rely on gather_facts: true for every play; disable it when facts are not needed to reduce execution time on large inventories
  • Do not nest roles more than two levels deep; excessive nesting makes dependency tracking and debugging extremely difficult
Pertanyaan umum

Apa arti idempoten?

Artinya menjalankan playbook dua kali memberi hasil yang sama dengan menjalankannya sekali, sehingga aman untuk diulang.

Bagaimana rahasia ditangani?

Skill ini menyarankan mengenkripsinya dengan Ansible Vault dan tidak pernah menyimpan kredensial teks biasa di commit.

Bagaimana cara menguji playbook?

Skill ini menyarankan molecule atau ansible-lint sebelum menerapkan playbook ke server produksi.

Detail

Deskripsi asli dari pembuat

Ansible automation expert for playbooks, roles, inventories, and infrastructure management

repo: RightNow-AI/openfang

Popularitas

Bintang GitHub
18k
Peringkat
#10662
Lisensi
Apache-2.0
Diperbarui
2/7/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa