一键导入
tpl-devops-ansible-server-setup
Template do pack (devops/05-ansible-server-setup.md). Orienta o agente em infra, deploy, CI/CD e operacao alinhado a esse contexto.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Template do pack (devops/05-ansible-server-setup.md). Orienta o agente em infra, deploy, CI/CD e operacao alinhado a esse contexto.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generate custom favicons from logos, text, or brand colours. Produces favicon.svg, favicon.ico, apple-touch-icon.png, icon-192/512.png, and web manifest. Use whenever the user wants a favicon, mentions replacing a CMS default favicon, converting a logo into a favicon, creating branded initials icons, or troubleshooting favicon not displaying / iOS black square / missing manifest.
"Get a second opinion from leading AI models on code, architecture, strategy, prompting, or anything. Queries models via OpenRouter, Gemini, or OpenAI APIs. Supports single opinion, multi-model consensus, and devil's advocate patterns. Use whenever the user says 'brains trust', 'second opinion', 'ask gemini', 'ask gpt', 'peer review', 'consult another model', 'challenge this', or 'devil's advocate'."
Run an independent code review using the OpenAI Codex CLI in headless mode. Gets a second opinion from a different model family (GPT-5/o3) on recent changes, a PR, a commit, or the whole app — covering bugs, regressions, security, data consistency, UX/state bugs, performance risks, and testing gaps. Saves a severity-prioritised report to .jez/reviews/. Triggers: 'codex review', 'review with codex', 'second opinion on this code', 'independent code review', 'what does codex think', 'get codex to review'.
Deep research and discovery before building something new. Explores local projects for reusable code, researches competitors, reads forums and reviews, analyses plugin ecosystems, investigates technical options, and produces a comprehensive research brief. Three depths: focused (30 min), wide (1-2 hours), deep (3-6 hours). Triggers: 'research this', 'deep research', 'discovery', 'explore the space', 'what should I build', 'competitive analysis', 'before I start building', 'research before coding'.
Plan and execute entire application builds. Generates phased delivery roadmaps, then executes them autonomously — phase by phase, committing at milestones, deploying, testing, and continuing until done or stuck. Modes: plan (generate roadmap), start (begin executing), resume (continue from where you left off), status (show progress). Triggers: 'roadmap', 'plan the build', 'start building', 'resume the build', 'keep going', 'build the whole thing', 'execute the roadmap', 'what phase are we on'.
Walk through a live web app AS a real user to find usability + behavioural bugs that static reviews miss. REQUIRES proof of interaction (typing, clicking, sending, observing) before any verdict — a sweep that didn't interact terminates with verdict 'Incomplete'. Walks threads, exercises every element, runs the multi-pane stress matrix, visual polish sweep, component perfection checklist, automated a11y (axe-core), pragmatic performance budget (LCP/CLS/INP), scenario battery (11 scenarios), and stress recipes including the real-flavour data battery. Hard gates: console errors/warnings = 0, network 5xx = 0, layout collapse = 0, axe Critical/Serious = 0, perf budget green. Audit-the-audit meta-check rejects rushed reports. Each finding has reproduction steps, evidence path, and suspected code location. Trigger with 'ux audit', 'walkthrough', 'qa sweep', 'audit the app', 'dogfood this', 'check all pages', 'find what's broken', 'stress the UI'.
| name | tpl-devops-ansible-server-setup |
| description | Template do pack (devops/05-ansible-server-setup.md). Orienta o agente em infra, deploy, CI/CD e operacao alinhado a esse contexto. |
| metadata | {"version":"1.0.0","source_template":"devops/05-ansible-server-setup.md","generated_by":"install_pack_templates_as_claude_skills"} |
Skill gerado a partir do pack templates-claude-code. Arquivo de origem: devops/05-ansible-server-setup.md. Use como baseline e adapte ao projeto antes de mudancas grandes.
ansible/
├── ansible.cfg
├── inventory/
│ ├── production.yml
│ └── staging.yml
├── group_vars/
│ ├── all.yml # Shared vars
│ ├── all/
│ │ └── vault.yml # Encrypted secrets (ansible-vault)
│ ├── webservers.yml
│ └── appservers.yml
├── host_vars/
│ └── web01.example.com.yml
├── playbooks/
│ ├── site.yml # Master playbook
│ ├── setup-server.yml
│ └── deploy-app.yml
└── roles/
├── common/
│ ├── tasks/main.yml
│ ├── handlers/main.yml
│ └── vars/main.yml
├── nginx/
│ ├── tasks/main.yml
│ ├── handlers/main.yml
│ ├── templates/
│ │ └── vhost.conf.j2
│ └── vars/main.yml
├── certbot/
├── ufw/
├── fail2ban/
└── nodejs/
state: present/absent, never bare shell commands that can double-execute.ansible-vault encrypt_string for inline secrets.notify: restart nginx, not a task. Handlers run only once per play, at the end.--tags nginx,certbot partial runs.become: true only when needed — task-level, not play-level wherever possible.--check --diff without side effects.vars/.validate: on config templates — validate: nginx -t -c %s before overwriting live config.# ansible/ansible.cfg
[defaults]
inventory = inventory/production.yml
remote_user = ubuntu
private_key_file = ~/.ssh/deploy_key
host_key_checking = True
retry_files_enabled = False
stdout_callback = yaml
callbacks_enabled = profile_tasks
gathering = smart # Cache facts
[privilege_escalation]
become = True
become_method = sudo
become_user = root
[ssh_connection]
pipelining = True # Speeds up execution significantly
control_path_dir = ~/.ansible/cp
ssh_args = -C -o ControlMaster=auto -o ControlPersist=60s
# inventory/production.yml
all:
vars:
ansible_python_interpreter: /usr/bin/python3
children:
webservers:
hosts:
web01.example.com:
ansible_host: 203.0.113.10
web02.example.com:
ansible_host: 203.0.113.11
appservers:
hosts:
app01.example.com:
ansible_host: 203.0.113.20
node_port: 3000
# playbooks/site.yml
---
- name: Apply common configuration
hosts: all
roles:
- common
- ufw
- fail2ban
- name: Setup web servers
hosts: webservers
roles:
- nginx
- certbot
- name: Setup app servers
hosts: appservers
roles:
- nodejs
---
- name: Update apt cache and upgrade packages
ansible.builtin.apt:
update_cache: true
upgrade: dist
cache_valid_time: 3600
tags: [common, packages]
- name: Install required packages
ansible.builtin.apt:
name:
- curl
- git
- unzip
- htop
- vim
- logrotate
- python3-pip
state: present
tags: [common, packages]
- name: Set timezone to UTC
community.general.timezone:
name: UTC
tags: [common, timezone]
- name: Ensure deploy user exists
ansible.builtin.user:
name: deploy
groups: sudo
shell: /bin/bash
create_home: true
state: present
tags: [common, users]
- name: Add SSH authorized key for deploy user
ansible.posix.authorized_key:
user: deploy
key: "{{ vault_deploy_pubkey }}"
state: present
tags: [common, users]
- name: Disable root SSH login
ansible.builtin.lineinfile:
dest: /etc/ssh/sshd_config
regexp: "^PermitRootLogin"
line: "PermitRootLogin no"
state: present
notify: restart sshd
tags: [common, security]
- name: Disable password authentication
ansible.builtin.lineinfile:
dest: /etc/ssh/sshd_config
regexp: "^PasswordAuthentication"
line: "PasswordAuthentication no"
state: present
notify: restart sshd
tags: [common, security]
---
- name: Install Nginx
ansible.builtin.apt:
name: nginx
state: present
tags: [nginx]
- name: Ensure Nginx is enabled and started
ansible.builtin.systemd:
name: nginx
enabled: true
state: started
tags: [nginx]
- name: Remove default Nginx site
ansible.builtin.file:
path: /etc/nginx/sites-enabled/default
state: absent
notify: reload nginx
tags: [nginx]
- name: Deploy vhost configuration
ansible.builtin.template:
src: vhost.conf.j2
dest: "/etc/nginx/sites-available/{{ nginx_vhost_name }}.conf"
owner: root
group: root
mode: "0644"
validate: "nginx -t -c %s"
notify: reload nginx
tags: [nginx, vhost]
- name: Enable vhost
ansible.builtin.file:
src: "/etc/nginx/sites-available/{{ nginx_vhost_name }}.conf"
dest: "/etc/nginx/sites-enabled/{{ nginx_vhost_name }}.conf"
state: link
notify: reload nginx
tags: [nginx, vhost]
---
- name: reload nginx
ansible.builtin.systemd:
name: nginx
state: reloaded
- name: restart nginx
ansible.builtin.systemd:
name: nginx
state: restarted
- name: restart sshd
ansible.builtin.systemd:
name: sshd
state: restarted
---
- name: Install UFW
ansible.builtin.apt:
name: ufw
state: present
tags: [ufw]
- name: Set UFW default policies
community.general.ufw:
direction: "{{ item.direction }}"
policy: "{{ item.policy }}"
loop:
- { direction: incoming, policy: deny }
- { direction: outgoing, policy: allow }
tags: [ufw]
- name: Allow SSH
community.general.ufw:
rule: allow
port: "22"
proto: tcp
tags: [ufw]
- name: Allow HTTP and HTTPS
community.general.ufw:
rule: allow
port: "{{ item }}"
proto: tcp
loop: ["80", "443"]
tags: [ufw]
- name: Enable UFW
community.general.ufw:
state: enabled
tags: [ufw]
---
- name: Install Certbot and Nginx plugin
ansible.builtin.apt:
name:
- certbot
- python3-certbot-nginx
state: present
tags: [certbot]
- name: Request SSL certificate
ansible.builtin.command:
cmd: >
certbot --nginx
-d {{ certbot_domain }}
--non-interactive
--agree-tos
--email {{ certbot_email }}
--redirect
creates: "/etc/letsencrypt/live/{{ certbot_domain }}/fullchain.pem"
tags: [certbot]
- name: Ensure renewal timer is enabled
ansible.builtin.systemd:
name: certbot.timer
enabled: true
state: started
tags: [certbot]
---
- name: Download NodeSource setup script
ansible.builtin.get_url:
url: https://deb.nodesource.com/setup_20.x
dest: /tmp/nodesource_setup.sh
mode: "0755"
tags: [nodejs]
- name: Run NodeSource setup
ansible.builtin.command:
cmd: bash /tmp/nodesource_setup.sh
creates: /etc/apt/sources.list.d/nodesource.list
tags: [nodejs]
- name: Install Node.js
ansible.builtin.apt:
name: nodejs
state: present
update_cache: true
tags: [nodejs]
- name: Install PM2 globally
community.general.npm:
name: pm2
global: true
state: present
tags: [nodejs, pm2]
- name: Configure PM2 startup
ansible.builtin.command:
cmd: pm2 startup systemd -u deploy --hp /home/deploy
changed_when: false
tags: [nodejs, pm2]
# Create vault-encrypted file
ansible-vault create group_vars/all/vault.yml
# Encrypt an inline value
ansible-vault encrypt_string 'supersecret' --name 'vault_deploy_pubkey'
# Run playbook with vault password file (CI)
echo "$ANSIBLE_VAULT_PASS" > /tmp/vault_pass
ansible-playbook playbooks/site.yml --vault-password-file /tmp/vault_pass
rm /tmp/vault_pass
# group_vars/all/vault.yml (encrypted)
vault_deploy_pubkey: "ssh-ed25519 AAAA..."
vault_db_password: "$(uuidgen)"
vault_jwt_secret: "$(openssl rand -hex 32)"
# Check syntax
ansible-playbook playbooks/site.yml --syntax-check
# Dry run with diff
ansible-playbook playbooks/site.yml --check --diff
# Run specific tags
ansible-playbook playbooks/site.yml --tags "nginx,certbot"
# Limit to one host
ansible-playbook playbooks/site.yml --limit web01.example.com
# Production run
ansible-playbook playbooks/site.yml --ask-vault-pass