6.8 KiB
name, description
| name | description |
|---|---|
| workstation-setup | Готовит рабочий компьютер для Server Ops, устанавливает недостающие инструменты или проверяет восстановление учётных данных на чистой копии репозитория в Linux. |
Use the server-ops checkout for all repository paths and commands in this skill.
Prepare the checkout
-
Detect the OS and existing tools in its shell, starting before Python is available. On Linux check
/etc/os-releaseand usecommand -v. In PowerShell use$PSVersionTable,Get-Command, andTest-Path. Reuse working tools and use the platform's approval flow for installation. -
On Linux install Git, Python with venv and pip support, and OpenSSH 8.4+ from the distribution. On Debian or Ubuntu refresh APT indexes and install the missing packages among
git,python3,python3-venv, andopenssh-client. Select a maintainedansible-corecompatible with the available Python. Create.venvwithpython3 -m venv .venvand install PyYAML, pyrage, and the compatible Ansible into it. Install SOPS, age,age-keygen, and Gitleaks 8.19+ from official packages or releases. Verify release checksums or signatures for manually downloaded binaries. Ansible support matrix -
On native Windows use PowerShell, Git for Windows, 64-bit Python 3.13+, and the system OpenSSH client. If Python is missing, use the official Python install manager and verify the runtime version and architecture. When WinGet is available, the manager can be installed with
winget install 9NQ7512CXL7T -e --accept-package-agreements --disable-interactivity. Discover it in a fresh PowerShell session if needed. Install the runtime withpy install 3.13, or usepymanagerif a legacy launcher interceptspy. Create.venvwith the selected runtime and install PyYAML into it. Verify%SystemRoot%\System32\OpenSSH\ssh.exe. If missing, useAdd-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0from an authorized elevated PowerShell. Install Gitleaks 8.19+ for the Git hook. Useagentorkey_filefor native SSH. Ansible and the repository's SOPS-backed operations use Linux. Python on Windows · Windows OpenSSH installation -
On Linux activate
.venvwith. .venv/bin/activatein each command shell that runs the repository tools. This exposes the interpreter and local SOPS, age, and Ansible binaries. On Windows call./.venv/Scripts/python.exedirectly. Use.venv/binor.venv/Scriptsfor project-local binaries. -
In the selected server-ops checkout, configure
git config --local core.hooksPath .githooksand verify the active path. Preserve any custom hooks already serving the checkout. If they cannot be chained safely, report the conflict and run the project check separately.
Prepare SOPS when needed
On Linux, python3 .agents/scripts/ops.py init-age prepares the identity
using the owner-only root .env. If servers/age-identity.age already exists,
restore its matching .env. Legacy encrypted records require their original
age identity for migration. A new setup without existing ciphertext can
generate a password and age identity. Keep existing entries in .env and
follow "Credentials" in the selected checkout's AGENTS.md.
Rehearse credential recovery on Linux
- Prepare a separate Linux checkout from the backup or revision being tested.
Confirm that it contains the requested server cards and their encrypted
credentials. For a wrapped age identity, confirm
servers/age-identity.ageis present and restore its matching ignored.envfrom protected storage with mode0600. For a legacy backup, restore its original protected age identity. Treat a missing or mismatched recovery artifact as a blocker. - In the activated venv run
python3 .agents/scripts/ops.py doctorandpython3 .agents/scripts/ops.py validate. Runpython3 .agents/scripts/ops.py check-secret ALIASfor each requested card that stores credentials. For a specific SSH profile also runpython3 .agents/scripts/ops.py doctor ALIAS --connection NAME --auth METHODwith the selectors that apply. Restore any external key file or SSH agent identity separately when that profile requires it. - Record the tested snapshot, covered profiles, exit statuses, and blockers. Report local decryption and profile readiness as such. If remote login is in scope, verify it separately using the server operation skill. Remove only disposable rehearsal copies you are authorized to discard.
Verify
- Run
python3 .agents/scripts/ops.py doctorin the active Linux venv or./.venv/Scripts/python.exe .agents/scripts/ops.py doctorin PowerShell. It checks tool availability, the active Git hook, and the project venv. AppendALIASand optional--connection NAME,--user LOGIN, or--auth METHODto check the pinned host key and the selected credentials locally.doctorreports the configured key's SHA-256 fingerprint. A failing check returns exit status 1. Connect separately to verify remote login. - Check tool versions. On Linux syntax-check
.agents/playbooks/ping.ymlusingANSIBLE_CONFIG=.agents/ansible.cfgand a disposable inventory. - In a temporary checkout, verify that the Git hook accepts valid staged files and rejects unsafe entries. On Linux verify a SOPS round trip with dummy data and a temporary age identity. Remove temporary data after testing.
- Report specific blockers and continue independent checks. Use disposable data for bootstrap checks and continue the requested server task after its local prerequisites are ready.
Optional RTK for Codex
- Reuse an existing RTK installation and Codex hook. Check
rtk --versionandrtk init --codex --show. If installing RTK, select the workstation's platform and architecture and verify the archive against the published checksum. Official RTK releases - For automatic compression, choose one hook scope. If there is no existing
hook, run
rtk init --codexfrom the selected server-ops checkout. Restart Codex and trust the project hook if prompted. For manual use, runrtk git statusorrtk rg PATTERN PATH. RTK setup for Codex - Run
rtk gain --projectfrom the server-ops checkout root to see estimated savings. Follow "Command output" in that checkout'sAGENTS.mdfor SSH, credentials, and exact output.