スキル一覧に戻る
poindexter12

ansible

by poindexter12

2🍴 0📅 2026年1月24日
GitHubで見るManusで実行

SKILL.md


name: ansible description: | Ansible automation reference for playbooks, roles, inventory, variables, and modules. Includes Proxmox VE and Docker integration via community.general and community.docker collections. Use when writing playbooks, troubleshooting Ansible runs, or designing automation workflows. Triggers: ansible, playbook, inventory, role, task, handler, vars, jinja2, galaxy, proxmox_kvm, proxmox_lxc, docker_container, docker_compose. agent: ansible-expert

Ansible Skill

Ansible automation reference for configuration management and application deployment.

Quick Reference

# Test connectivity
ansible all -m ping
ansible <group> -m ping

# Run playbook
ansible-playbook playbook.yml
ansible-playbook playbook.yml -l <host>    # Limit to host
ansible-playbook playbook.yml --check      # Dry-run
ansible-playbook playbook.yml -vvv         # Verbose

# Tags
ansible-playbook playbook.yml --tags "deploy"
ansible-playbook playbook.yml --skip-tags "backup"
ansible-playbook playbook.yml --list-tags

# Variables
ansible-playbook playbook.yml -e "var=value"
ansible-playbook playbook.yml -e "@vars.yml"

# Ad-hoc commands
ansible <group> -m shell -a "command"
ansible <group> -m copy -a "src=file dest=/path"
ansible <group> -m apt -a "name=package state=present"

# Galaxy
ansible-galaxy collection install -r requirements.yml
ansible-galaxy role install <role>

Reference Files

Load on-demand based on task:

TopicFileWhen to Load
Playbook Structureplaybooks.mdWriting playbooks
Inventoryinventory.mdHost/group configuration
Variablesvariables.mdVariable precedence, facts
Modulesmodules.mdCommon module reference
Troubleshootingtroubleshooting.mdCommon errors, debugging

Proxmox Integration

TopicFileWhen to Load
Proxmox Modulesproxmox/modules.mdVM/LXC management via API
Proxmox Authproxmox/authentication.mdAPI tokens, credentials
Proxmox Gotchasproxmox/gotchas.mdCommon issues, workarounds
Dynamic Inventoryproxmox/dynamic-inventory.mdAuto-discover VMs/containers

Docker Integration

TopicFileWhen to Load
Docker Deploymentdocker/deployment.mdContainers, images, networks, volumes
Compose Patternsdocker/compose-patterns.mdRoles, templates, multi-service stacks
Docker Troubleshootingdocker/troubleshooting.mdCommon errors, debugging

Playbook Quick Reference

---
- name: Deploy application
  hosts: webservers
  become: true
  vars:
    app_port: 8080

  pre_tasks:
    - name: Validate requirements
      ansible.builtin.assert:
        that:
          - app_secret is defined

  tasks:
    - name: Install packages
      ansible.builtin.apt:
        name: "{{ item }}"
        state: present
      loop:
        - nginx
        - python3

    - name: Deploy config
      ansible.builtin.template:
        src: app.conf.j2
        dest: /etc/app/app.conf
      notify: Restart app

  handlers:
    - name: Restart app
      ansible.builtin.service:
        name: app
        state: restarted

  post_tasks:
    - name: Verify deployment
      ansible.builtin.uri:
        url: "http://localhost:{{ app_port }}/health"

Variable Precedence (High to Low)

  1. Extra vars (-e "var=value")
  2. Task vars
  3. Block vars
  4. Role/include vars
  5. Play vars
  6. Host facts
  7. host_vars/
  8. group_vars/
  9. Role defaults

Directory Structure

ansible/
├── ansible.cfg          # Configuration
├── inventory/
│   └── hosts.yml        # Inventory
├── group_vars/
│   ├── all.yml          # All hosts
│   └── webservers.yml   # Group-specific
├── host_vars/
│   └── server1.yml      # Host-specific
├── roles/
│   └── app/
│       ├── tasks/
│       ├── handlers/
│       ├── templates/
│       ├── files/
│       └── defaults/
├── playbooks/
│   └── deploy.yml
├── templates/
│   └── config.j2
└── requirements.yml     # Galaxy dependencies

Idempotency Checklist

  • Tasks produce same result on repeated runs
  • No changed_when: true unless necessary
  • Use state: present/absent not shell commands
  • Check mode (--check) shows accurate changes
  • Second run shows all "ok" (no changes)

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です