/server-setup:infra-bootstrapfrom server-setup
Bootstraps a new infrastructure-as-code project using Ansible and the ahmz1833.server_setup collection. Scaffolds vaulted, validated repos for servers, clusters, or organizations.
Ships in server-setup. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Goal: a small, readable repo in the standard layout that the user (with or without AI)
can run with make, with every sensitive value vaulted and the attack surface minimal
from day one. The infra-iac skill's golden rules apply throughout — read its
references/security.md and references/iac-standard.md if available.
Ask in one message, offering sensible defaults:
is_iran: true), how you reach them (direct/bastion/VPN). Addresses,
SSH ports and usernames are vault material — the user enters them, not the chat.prod, or staging + prod?Never ask the user to paste credentials into the chat. Identifiers (IPs, SSH ports, domains,
usernames) may be given to you — put them straight into the vault, never into plaintext
files. Credentials: you write placeholders (*.example, vault_* references), the user
types real values via make vault-edit, random ones come from make vault-gen KEY=….
After hosts exist, run make ssh-config. See infra-iac → "Secrets: identifiers yes,
credentials never".
assets/starter/ (bundled with this skill): single environment, one web host,
core + node(docker) + acme + nginx + apps. Right for most single servers.examples/ (after setup:
collections/ansible_collections/ahmz1833/server_setup/examples/, or
git clone --depth 1 https://github.com/ahmz1833/server-setup into a temp dir):
multi-env-cluster (staging/prod, per-env vault ids, k3s HA, mail, local role,
vaulted vault_hosts map) and fleet (many unrelated servers, function + location
groups, per-host sites, CI app deploys).
Combine patterns as needed; the examples are references, not templates to keep intact.cp -r <skill>/assets/starter/. <target>/ (includes dotfiles: .gitignore,
.yamllint, .ansible-lint).inventories/<env>/hosts.yml: function groups (web, k3s_servers, mail, …)
and logical host names. No addresses here.host_vars/<host>/vault.yml(.example) for address/port. Many hosts →
one vaulted vault_hosts map in group_vars/all (see multi-env-cluster).infra-iac's
references/roles-index.md (or ansible-doc -t role ahmz1833.server_setup.<role>).
Delete unused playbooks/vars rather than leaving dead config.comment; management/monitoring ports
with src: restricted (vaulted CIDR).inventories/prod → inventories/staging, same groups.iac-standard.md §5 — local role,
playbooks/dns.yml with the provider module, terraform/, k8s/ — each with a
make target and a line in AGENTS.md.AGENTS.md and README.md; remove the <placeholders>. Keep the "Agent
skills (install if missing)" section — it makes any agent on a new machine install
these skills (make skills) before touching the infra. Add only
project specifics below it.git init if not inside a repo (ask first if the location is ambiguous).make setup # ansible (.venv if needed) + latest collection
make vault-init # or: make vault-init ENV=<env> VAULT_PER_ENV=1 (per-env passwords)
# random secrets (never printed), e.g. a k3s token:
make vault-gen KEY=vault_k3s_token
# the USER fills real values (give an explicit hand-off per file and key):
make vault-edit FILE=inventories/prod/group_vars/all/vault.yml
make vault-edit FILE=inventories/prod/host_vars/<host>/vault.yml
make vault-keys # you verify key names only
make validate # offline: vars vs role argument specs
make lint
make ping
make check LIMIT=<host>
.vault_pass* in their password manager.files/ssh_keys/admin.pub..become_pass (mode 600, gitignored;
.become_pass.<env> per environment) — all make ansible commands use it without prompting.make apply LIMIT=<host> EXTRA="-u root" (confirm first). It creates the admin user,
hardens SSH and enables the firewall — follow the lockout precautions (keep a session
open, verify a new login before closing).make vault-check passes; .gitignore covers .venv/ collections/ .vault_pass*.make help), what's vaulted,
security posture (what's exposed and to whom), next steps (DNS records, PTR for mail,
monitoring hookup).From here on, the infra-iac skill handles changes and operations.
assets/starter/AGENTS.md (opens in a new tab)assets/starter/CLAUDE.md (opens in a new tab)assets/starter/Makefile (opens in a new tab)assets/starter/README.md (opens in a new tab)assets/starter/ansible.cfg (opens in a new tab)assets/starter/files/ssh_keys/README.md (opens in a new tab)assets/starter/inventories/prod/group_vars/all/main.yml (opens in a new tab)assets/starter/inventories/prod/group_vars/all/vault.yml.example (opens in a new tab)assets/starter/inventories/prod/group_vars/web/main.yml (opens in a new tab)assets/starter/inventories/prod/host_vars/web-1/main.yml (opens in a new tab)assets/starter/inventories/prod/host_vars/web-1/vault.yml.example (opens in a new tab)assets/starter/inventories/prod/hosts.yml (opens in a new tab)assets/starter/playbooks/apps.yml (opens in a new tab)assets/starter/playbooks/base.yml (opens in a new tab)assets/starter/playbooks/ops/reboot.yml (opens in a new tab)assets/starter/playbooks/ops/restart.yml (opens in a new tab)assets/starter/playbooks/ops/upgrade.yml (opens in a new tab)assets/starter/playbooks/site.yml (opens in a new tab)assets/starter/playbooks/web.yml (opens in a new tab)assets/starter/requirements.txt (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/infra-iacOperate servers and infrastructure the IaC way - Ansible with the ahmz1833.server_setup collection as the baseline, plus local roles, DNS/cloud (Terraform/OpenTofu, provider modules) and Kubernetes manifests where needed. Use for ANY request touching servers, clusters, DNS, networks or an infrastructure repository - inspecting or debugging hosts ("why is X down", "check disk"), one-off jobs ("restart nginx", "reboot", "drain node", "fetch kubeconfig"), and persistent changes ("open a port", "add a site/app/user/host", "change config", "upgrade k3s"). Enforces that state changes go through code, secrets and exposure-sensitive values go to ansible-vault (repo assumed public), and that attack surface is minimized and risks are reported. Routes to infra-bootstrap for new projects and server-setup-dev for work on the collection itself./server-diagnosticsDebug availability and performance of servers and the services on them, and measure/vet machines - outages, downtime, flapping, restarts, slowness, saturation, resource exhaustion, packet loss, throughput; using every metrics/logging source available (Prometheus-style metrics, exporters, logs, Kubernetes metrics, sysstat, provider graphs); plus benchmarks (CPU/memory/disk), network tests between servers or to the internet (iperf3, mtr) and egress/IP reputation checks. Use for any "why is X down/slow/unstable", "is this server good enough", "test bandwidth", "is this IP clean" request, whatever the workload (Kubernetes, VPN/tunnels, web, databases, mail, CI...). Read-only and ephemeral by default; fixes go through infra-iac.npx claudepluginhub ahmz1833/server-setup --plugin server-setup