Ansible collection: ahmz1833.server_setup
Roles for Debian/Ubuntu-style hosts: base hardening, edge Nginx (optional ModSecurity), TLS automation, Docker workloads, and optional SSH-into-container sandboxes. Binaries and static bundles are installed through a shared asset role used internally by node, nginx, and k3s.
Galaxy namespace: ahmz1833 · Collection name: server_setup · FQCN prefix: ahmz1833.server_setup.<role>
Beyond roles, this repo ships an infrastructure-as-code standard, full example projects, and AI agent skills so that servers can be bootstrapped, changed, operated and debugged - by a human or an agent - while everything stays in code, secrets stay in vaults and the attack surface stays small.
Using with AI agents
Four skills (in skills/) teach an agent to work this way:
| Skill | For |
|---|
infra-iac | any request touching servers or an infra repo: inspect/debug, one-off jobs, persistent changes through IaC, security review |
infra-bootstrap | creating a new IaC project from an interview |
server-setup-dev | developing this collection, or upstreaming a local role |
server-diagnostics | availability & performance debugging using all available metrics/logs; benchmarks, network tests (iperf3), IP reputation — ephemeral, no trace |
Install (no clone of this repo needed):
# Claude Code plugin
/plugin marketplace add ahmz1833/server-setup
/plugin install server-setup@server-setup
# or: /plugin install server-setup --marketplace ahmz1833/server-setup
# Any agent supported by the skills CLI (Claude Code, Codex, Cursor, …)
npx skills add ahmz1833/server-setup # all skills
npx skills add ahmz1833/server-setup --skill infra-iac
The skills are self-contained (bundled references and the starter project) and install Ansible plus the latest collection on demand. Projects created from the starter also carry an AGENTS.md/CLAUDE.md, so agents pick up the rules even without the skills.
Start a project
cp -r examples/starter ~/infra/my-project && cd ~/infra/my-project # or let infra-bootstrap do it
make setup # ansible (.venv if needed) + latest collection into ./collections
make vault-init # encrypted vault files from *.example, generates .vault_pass
make vault-edit # real values (admin user, addresses, ports …)
make validate # offline: vars vs role argument specs
make check LIMIT=web-1 && make apply LIMIT=web-1
| Example | Shows |
|---|
examples/starter | single server: core, node (docker), acme, nginx + WAF, apps; ops playbooks |
examples/multi-env-cluster | staging/prod with per-env vault ids, k3s HA, mail, source-restricted management, local role |
examples/fleet | heterogeneous servers, function + location groups, relay, sandboxes, monitoring, CI app deploys |
No Python on the machine? make docker-shell runs everything in
ghcr.io/ahmz1833/server-setup:<version> (ansible + this collection + dependencies).
Requirements
| Requirement | Notes |
|---|
| Ansible | ansible-core 2.15+ (meta/runtime.yml); examples pin 2.16–2.19 |
| Python | 3.9+ on the controller |
| Targets | Roles are written for systemd-based Linux; several roles assume Debian/Ubuntu packages or paths—see each role README. |
Collection dependencies
Declared in galaxy.yml; install with the collection or via ansible-galaxy collection install -r requirements.yml:
| Collection | Purpose (examples) |
|---|
community.general | archive, and other helpers |
community.crypto | TLS / crypto (e.g. ACME) |
community.docker | docker_container, docker_network, … |
ansible.posix | sysctl, authorized_key, … |
ansible.utils | IP / text utilities where used |
Installation
From Ansible Galaxy (after publish)
ansible-galaxy collection install ahmz1833.server_setup
Pin a version:
ansible-galaxy collection install ahmz1833.server_setup:==1.5.0
From Git
requirements.yml: