mirror of
https://github.com/fscotto/infra.git
synced 2026-09-27 11:02:47 +00:00
8.0 KiB
8.0 KiB
AGENTS.md
Ansible-driven personal infrastructure repo for Fedora and Void desktops, FreeBSD transition targets, WSL, and an Ubuntu server.
Source Of Truth
- Main orchestration:
ansible/site.yml - Inventory and layering inputs:
ansible/inventory/hosts.yml,ansible/inventory/group_vars/*.yml,ansible/inventory/host_vars/*.yml - Dotfiles live under
dotfiles/ - AI agent instructions (bootstrap, rules, knowledge) are centralized in
dotfiles/common/.config/ai/and shared between OpenCode, Codex, and Gemini CLI. - OpenCode loads its entrypoint configuration from
dotfiles/common/.config/opencode/opencode.json. - Codex config is rendered from
dotfiles/common/.codex/config.toml.j2somodel_instructions_filepoints to the deployed~/.config/ai/bootstrap.md.
Topology
- Current personal desktop:
ikaros = platform_fedora + role_personal_workstation + graphical_desktop + desktop_gnome - Current laptop:
nymph = platform_fedora + graphical_desktop + desktop_gnome - Void desktop profile is also the base for other future/reference hosts via
platform_void + graphical_desktop - Workstation:
deadalusis Windows + WSL; Ansible target isdeadalus-wsl - Ubuntu server:
prometheus - Hosts intentionally belong to multiple groups; trust
ansible/site.ymlover hostname assumptions. - Inventory axes are independent:
platform_*,role_*, anddesktop_*. Legacyvoidanddesktopremain compatibility parents.
Working Rules
- Preserve layering
all -> platform -> role -> desktop -> host. - Keep
ansible/site.ymlsmall; orchestration belongs there, implementation belongs in roles. - Prefer minimal, targeted edits. Preserve idempotency and existing ordering.
- All hosts use
ansible_connection: local. - Treat
secrets/as sensitive. Never print secret values. - Tmux plugins are bootstrapped by TPM on the host; the repo only keeps tmux config and custom helper scripts.
- Read the relevant role tasks, templates, vars, and deployed dotfiles before editing.
Validation
- Default minimum:
ansible-playbook ansible/site.yml --syntax-check
- Repo-wide checks:
ansible-lint ansible/site.ymlansible-lint ansible/rolesyamllint ansible/
- Host-focused dry runs:
- Fedora desktop work:
ansible-playbook ansible/site.yml --limit ikaros --check --diff - Fedora laptop work:
ansible-playbook ansible/site.yml --limit nymph --check --diff - WSL dev:
ansible-playbook ansible/site.yml --limit deadalus-wsl --check --diff - Server:
ansible-playbook ansible/site.yml --limit prometheus --check --diff
- Fedora desktop work:
- Focused checks:
- Emacs is disabled by default; temporary Emacs check:
ansible-playbook ansible/site.yml --limit <host> --tags emacs --check --diff -e emacs_enabled=true - Mail bootstrap:
sh -n scripts/bootstrap_mail.shandshellcheck scripts/bootstrap_mail.sh - Server compose render:
docker compose -f /opt/docker/server/docker-compose.yml config
- Emacs is disabled by default; temporary Emacs check:
Conventions
- Use FQCN Ansible modules.
- Prefer declarative modules over
command/shell; whenshellis required, make idempotency and failure behavior explicit. - Start YAML files with
---, use 2-space indentation, and keep file modes quoted like"0644". - Keep booleans as booleans and structured vars as YAML lists/maps.
- Put host-specific overrides in
host_vars, not sharedgroup_vars. - Use
no_log: truefor secret-bearing task inputs or outputs.
Desktop Notes
desktop_profilenames independently selectable desktop groups such asdesktop_gnome,desktop_sway, anddesktop_niri. Keep platform-specific session bootstrap in platform-specific roles.desktop_environmentis fixed tominimalfor Void desktops.profile_desktop_commonowns shared Void bootstrap;profile_desktop_swayandprofile_desktop_nirimanage the enabled sessions, whileprofile_desktop_gnomecopies shared desktop dotfiles for Fedora/GNOME without managing GNOME settings.desktop_sessions_enabledanddesktop_default_sessionapply to the minimal mode.- Emacs packages and
.emacs.ddeploy are disabled by default viaemacs_enabled: false; keep the dotfiles in the repo for reversible opt-in only. - NTFS filesystem support is provided by
ntfs-3ginansible/inventory/group_vars/void.yml. - Void user services are managed by
turnstileand live underdotfiles/desktop/.config/service/. ssh-agentkeeps the stable socket~/.local/state/ssh-agent/socket.- Critical session entrypoints:
dotfiles/desktop/.config/sway/configplushost.confandsession-envdeployed viahost_sway_dotfiles(sway / Wayland)dotfiles/desktop/.config/niri/config.kdlandsession-envdeployed viadesktop_niri_dotfiles(Niri / Wayland)
- Void Niri lives in
profile_desktop_niri, gated on'niri' in desktop_sessions_enabled; it installs theempttyniri.desktopsession, the/usr/local/bin/start-nirilauncher, and the xdg-desktop-portal config, mirroringprofile_desktop_sway. - Fedora GNOME (
desktop_gnome) assumes GNOME comes from the Fedora Workstation base install; Ansible deploys shared desktop dotfiles and git/GPG config forikarosandnymph, not GNOME settings. - Do not switch or restart the display manager during a playbook run from an active graphical session.
nymphis the Fedora/GNOME laptop target; keep GNOME settings unmanaged for now and add host-specific tuning only after real use.
Void Package And Dotfile Bucket Rules
platform_void is the reusable Void platform selection. The legacy void group remains a compatibility parent so existing group_vars/void.yml and when: "'void' in group_names" checks keep working during the transition.
The Void desktop package lists in ansible/inventory/group_vars/void.yml are kept disjoint by role:
void_packages_base— system runtime only (init/services, kernel, audio core, networking, filesystem, firewall, hardware daemons, runit logging).desktop_common_packages— GUI infrastructure shared by the minimal desktop mode.desktop_minimal_packages— applications, integration components, and theempttydisplay manager.desktop_sway_packages— binaries specific to the Sway session.profile_packagesin the same file is cross-distro and is overridden bygroup_vars/server.ymland the workstation group vars; do not move desktop-specific Void entries through it. The dotfile vars follow the same split:desktop_common_dotfilescarries mode-independent content anddesktop_minimal_dotfilescarries Thunar, Udiskie, and MIME defaults.desktop_void_dotfilesremains reserved for files that need the Void runtime.
Workstation Notes
deadalusis modeled as Windows + WSL; keep Linux dev automation ondeadalus-wsl.- Native Linux workstation groups remain available for future hosts but have no current host in the main inventory.
Coding Agent Notes
- Shared agent packages live in
ai_agents_npm_packagesinansible/inventory/group_vars/all.yml. - Shared agent dotfiles live in
ai_agents_dotfiles; rendered configs live inai_agents_templates. - Desktop, native workstation, and WSL profiles consume the shared agent package list; do not duplicate package entries in profile-specific vars.
dotfiles_commoncopies common dotfiles plusai_agents_dotfiles, then rendersai_agents_templates.- Keep
.config/ai/as the common instruction source; update agent-specific entrypoints to reference it rather than duplicating instruction text.
Tooling Notes
- Install local tooling with:
python3 -m pip install ansible ansible-lint yamllint shellcheck-pyansible-galaxy collection install -r ansible/collections/requirements.yml
- Required collections currently include
ansible.posixandcommunity.general. .yamllinttreatsline-lengthas a warning at 120 chars and disablesdocument-startandcomments-indentation.
When Updating Docs
- Keep
README.mdandAGENTS.mdaligned when workflows materially change. - If you add a new operational area, also add the narrowest validation command for it.
- Call out checks you could not run and any follow-up verification needed.