### Start Docker Compose Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/install-guide.md Command to start the RackPeek service defined in Docker Compose. ```bash docker compose up -d ``` -------------------------------- ### Example Playbook – Database Setup Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ansible-generator-guide.md An Ansible playbook example to install PostgreSQL on database servers. ```yaml - name: Configure database servers hosts: role_database become: true tasks: - name: Install PostgreSQL ansible.builtin.apt: name: postgresql state: present update_cache: true ``` -------------------------------- ### Test Native CLI Installation Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/install-guide.md Command to verify the native RackPeek CLI installation. ```bash rpk --help ``` -------------------------------- ### Install .NET SDK Prerequisites on Ubuntu Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/dev-setup.md Installs necessary prerequisites for .NET SDK installation on Ubuntu Linux. ```shell sudo apt update sudo apt install -y wget apt-transport-https software-properties-common ``` -------------------------------- ### Example Playbook – Deploy Web Servers Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ansible-generator-guide.md An Ansible playbook example to install and ensure Nginx is running on web servers. ```yaml - name: Configure web servers hosts: role_web become: true tasks: - name: Install nginx ansible.builtin.apt: name: nginx state: present update_cache: true - name: Ensure nginx running ansible.builtin.service: name: nginx state: started enabled: true ``` -------------------------------- ### Verify .NET Installation on Ubuntu Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/dev-setup.md Verifies the installed .NET SDK version on Ubuntu. ```shell dotnet --version ``` -------------------------------- ### Install .NET 10 SDK on Ubuntu Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/dev-setup.md Installs the .NET 10 SDK on Ubuntu Linux. ```shell sudo apt install -y dotnet-sdk-10.0 ``` -------------------------------- ### Install Just via Homebrew Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/dev-setup.md Installs the Just tool using the Homebrew package manager. ```shell brew install just ``` -------------------------------- ### Container Filtering Examples Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/docker-gen-guide.md Examples of using container filters for docker-gen. ```bash DOCKER_CONTAINER_FILTERS=label=homepage.name ``` ```bash DOCKER_CONTAINER_FILTERS=label=traefik.http.routers,status=running ``` -------------------------------- ### Install Native CLI Binary Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/install-guide.md Commands to make the downloaded RackPeek binary executable and move it to the system's PATH. ```bash chmod +x rackpeek sudo mv rackpeek /usr/local/bin/rpk ``` -------------------------------- ### Install Docker Desktop on MacOS Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/dev-setup.md Installs Docker Desktop on MacOS using Homebrew and starts the daemon. ```shell brew install --cask docker open -a Docker # start the daemon; wait until the whale icon settles ``` -------------------------------- ### Create Native CLI Config Directory Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/install-guide.md Commands to create the necessary configuration directory and file for the native RackPeek installation. ```bash sudo mkdir -p /usr/local/bin/config sudo touch /usr/local/bin/config/config.yaml ``` -------------------------------- ### Docker Bind Mount Configuration Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/install-guide.md Example of using a bind mount in Docker Compose for storing YAML directly on the host. ```yaml volumes: - /path/on/host/rackpeek:/app/config ``` -------------------------------- ### YAML Configuration Example Source: https://github.com/timmoth/rackpeek/blob/main/AGENTS.md Example of the top-level structure for the YAML configuration file. ```yaml resources: - kind: Server | Switch | Firewall | Router | Accesspoint | Desktop | Laptop | Ups | System | Service name: tags: [...] labels: { key: value } notes: | free-form markdown runsOn: [, ...] # only meaningful for System / Service # kind-specific fields follow (e.g. ports[], cpus[], drives[], gpus[], nics[], network, ram, …) ``` -------------------------------- ### Running E2E Tests Setup Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/testing-guidelines.md Commands to build the Docker image, install Playwright CLI, build the project, install Playwright browsers, and run tests. ```bash cd RackPeek docker build -t rackpeek:ci -f RackPeek.Web/Dockerfile . cd Tests.E2e donet tool install --global Microsoft.Playwright.CLI donet build playwright install donet test ``` -------------------------------- ### Install .NET 10 SDK on MacOS Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/dev-setup.md Installs the .NET 10 SDK on MacOS using Homebrew. ```shell brew install --cask dotnet-sdk ``` -------------------------------- ### Install VHS via Homebrew Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/dev-setup.md Installs the VHS tool using the Homebrew package manager. ```shell brew install vhs ``` -------------------------------- ### Example Resource Configuration Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ansible-generator-guide.md A complete example of a resource definition including tags and labels for Ansible. ```yaml - kind: System type: vm os: ubuntu-22.04 cores: 4 ram: 8 name: vm-web01 tags: - prod - web labels: ansible_host: 192.168.1.10 ansible_user: ubuntu ansible_var_mac: 52:54:00:11:22:33 env: prod role: web ``` -------------------------------- ### Download and Register Microsoft Package Repository Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/dev-setup.md Downloads and installs the Microsoft package repository configuration for Ubuntu. ```shell wget https://packages.microsoft.com/config/ubuntu/${RACKPEEK_KERNEL_VERSION}/packages-microsoft-prod.deb -O packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb rm packages-microsoft-prod.deb sudo apt update ``` -------------------------------- ### Verify Docker Installation on MacOS Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/dev-setup.md Verifies the Docker installation on MacOS. ```shell docker info ``` -------------------------------- ### Example Generated Inventory Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ansible-generator-guide.md An example of the inventory file generated by RackPeek. ```ini [all:vars] ansible_python_interpreter=/usr/bin/python3 ansible_user=ansible [env_prod] vm-web01 ansible_host=192.168.1.10 ansible_user=ubuntu mac=52:54:00:11:22:33 [role_web] vm-web01 ansible_host=192.168.1.10 ansible_user=ubuntu mac=52:54:00:11:22:33 [prod] vm-web01 ansible_host=192.168.1.10 ansible_user=ubuntu mac=52:54:00:11:22:33 ``` -------------------------------- ### Install Explicit .NET 10 SDK on MacOS Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/dev-setup.md Installs a specific version of the .NET 10 SDK on MacOS if the default installation is too old. ```shell brew install --cask dotnet-sdk@10 ``` -------------------------------- ### Download Native CLI Binary (wget) Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/install-guide.md Command to download the RackPeek native CLI binary for Linux using wget. ```bash wget https://github.com/Timmoth/RackPeek/releases/download/RackPeek-0.0.3/rackpeek_0_0_3_linux-x64 -O rackpeek ``` -------------------------------- ### Docker CLI Configuration Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/git-integration.md Example command for setting up RackPeek with Git integration using the Docker CLI. ```bash docker run -d \ --name rackpeek \ -p 8080:8080 \ -v rackpeek-config:/app/config \ -e GIT_TOKEN=your_token_here \ -e GIT_USERNAME=your_username \ aptacode/rackpeek:latest ``` -------------------------------- ### Demo Build Commands Source: https://github.com/timmoth/rackpeek/blob/main/AGENTS.md Commands for building demo recordings (VHS and GIF). ```bash just build-cli-demo # VHS recording — needs vhs, imagemagick, chrome just build-web-demo # GIF capture — needs Chrome, ImageMagick ``` -------------------------------- ### Setup Playwright Browsers for E2E Tests Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/dev-setup.md Installs Playwright CLI and downloads necessary browsers for end-to-end testing. ```shell just e2e-setup ``` -------------------------------- ### Docker Compose Configuration Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/git-integration.md Example configuration for setting up RackPeek with Git integration using Docker Compose. ```yaml version: "3.9" services: rackpeek: image: aptacode/rackpeek:latest container_name: rackpeek ports: - "8080:8080" volumes: - rackpeek-config:/app/config environment: - GIT_TOKEN=your_token_here - GIT_USERNAME=your_username # Uncomment the next line only if your Git host uses a private CA # or a self-signed certificate (common for home-lab Gitea instances): # - GIT_INSECURE_TLS=true restart: unless-stopped volumes: rackpeek-config: ``` -------------------------------- ### Download Native CLI Binary (curl) Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/install-guide.md Command to download the RackPeek native CLI binary for Linux using curl. ```bash curl -L https://github.com/Timmoth/RackPeek/releases/download/RackPeek-0.0.3/rackpeek_0_0_3_linux-x64 -o rackpeek ``` -------------------------------- ### Running the Ping Playbook Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ansible-generator-guide.md Command to run the example Ansible playbook. ```bash ansible-playbook -i inventory.ini ping.yml ``` -------------------------------- ### Example Playbook – Ping Production Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ansible-generator-guide.md An Ansible playbook example to test connectivity to production hosts. ```yaml - name: Test production connectivity hosts: env_prod gather_facts: false tasks: - name: Ping hosts ansible.builtin.ping: ``` -------------------------------- ### CLI Example Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/hosts-file-export.md Command-line interface example for exporting hosts file. ```bash rpk export hosts \ --include-tags prod \ --domain-suffix home.local \ --output hosts.txt ``` -------------------------------- ### Run E2E Tests (Playwright) - Setup Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/dev-cheat-sheet.md Install Playwright CLI tooling and dependencies for end-to-end tests. ```bash cd Tests.E2e dotnet tool install --global Microsoft.Playwright.CLI dotnet build playwright install ``` -------------------------------- ### Capture Web UI Demo Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/dev-cheat-sheet.md Make a script executable, install npm dependencies, and run the web UI capture process. ```bash chmod +x webui_capture.sh ``` ```bash cd vhs npm install node capture.js ./webui_capture.sh ``` -------------------------------- ### Example Playbook Usage with Custom Variables Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ansible-generator-guide.md Example of using custom variables like 'mac' in an Ansible playbook. ```yaml - hosts: all gather_facts: false tasks: - name: Copy ignition file ansible.builtin.copy: src: "output/{{ inventory_hostname }}.ign" dest: "/srv/ignition/{{ mac }}.ign" ``` -------------------------------- ### Execute Docker CLI Commands Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/install-guide.md Commands to execute RackPeek CLI commands directly inside the Docker container. ```bash docker exec -it rackpeek rpk --help ``` ```bash docker exec -it rackpeek rpk systems list ``` -------------------------------- ### Remote Machine Docker Socket Proxy Example Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/docker-gen-guide.md Example compose project for a remote machine to run a docker socket proxy. ```yaml services: docker-socket-proxy: image: tecnativa/docker-socket-proxy ports: "2375:2375" volumes: - "/var/run/docker.sock:/tmp/docker.sock" environment: - POST=0 - CONTAINERS=1 ``` -------------------------------- ### Add and Set Service (CLI) Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/resource-levels.md Example of adding a service and then setting its run-on target, IP, port, and URL using the command line interface. ```bash rpk services add jellyfin rpk services set jellyfin --runs-on media-vm --ip 10.0.10.50 --port 8096 --url https://jellyfin.home.lab ``` -------------------------------- ### Set Native CLI Config Directory Ownership Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/install-guide.md Command to set ownership for the native RackPeek configuration directory if needed. ```bash sudo chown -R $USER:$USER /usr/local/bin/config ``` -------------------------------- ### Minimal Global Vars Example Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ansible-generator-guide.md Example of keeping global variables minimal in Ansible. ```ini [all:vars] ansible_user=ansible ansible_python_interpreter=/usr/bin/python3 ``` -------------------------------- ### Docker Install Source: https://github.com/timmoth/rackpeek/blob/main/README.md Instructions for running RackPeek using Docker, including named volume and bind mount options. ```text # Named volume docker volume create rackpeek-config docker run -d \ --name rackpeek \ -p 8080:8080 \ -v rackpeek-config:/app/config \ aptacode/rackpeek:latest # Bind mount docker run -d \ --name rackpeek \ -p 8080:8080 \ -v $(pwd)/config:/app/config \ aptacode/rackpeek:latest # Note - RackPeek stores its state in YAML config/ └── config.yaml ``` -------------------------------- ### Final Connection Examples Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ssh-config-export.md Shows the SSH commands to connect to the resources defined in the final example output. ```bash ssh vm-db01 ssh vm-web01 ``` -------------------------------- ### Run Commands Source: https://github.com/timmoth/rackpeek/blob/main/AGENTS.md Commands for running the application, including Docker, CLI, and cleaning the project. ```bash just run-docker # build + run container on http://localhost:8080 just rpk [args] # run CLI directly from Debug build just clean # dotnet clean ``` -------------------------------- ### Advanced Pattern Play Targeting Examples Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ansible-generator-guide.md Examples of targeting plays using the advanced pattern with 'env' and 'role'. ```bash ansible-playbook site.yml -l env_prod ansible-playbook site.yml -l role_web ansible-playbook site.yml -l env_prod:&role_web ``` -------------------------------- ### Add and Set System (CLI) Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/resource-levels.md Example of adding a system and then setting its type, OS, and the system it runs on using the command line interface. ```bash rpk systems add proxmox-ve rpk systems set proxmox-ve --type hypervisor --os "Proxmox VE 8.3" --runs-on pve-01 ``` -------------------------------- ### SSH Connection Example Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ssh-config-export.md Demonstrates how to connect to a resource using its generated SSH alias. ```bash ssh vm-web01 ``` -------------------------------- ### Standard Ansible Labels Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ansible-generator-guide.md Example of standard Ansible labels that RackPeek exports as host variables. ```yaml labels: ansible_host: 192.168.1.10 ansible_user: ubuntu ansible_port: 22 ansible_ssh_private_key_file: ~/.ssh/id_rsa ``` -------------------------------- ### Generate CLI Demo (VHS) Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/dev-cheat-sheet.md Install necessary tools and run a CLI demo using VHS. ```bash brew install vhs brew install imagemagick brew install --cask google-chrome # if not already installed ``` ```bash cd vhs vhs ./rpk.tape ``` -------------------------------- ### Ansible Infrastructure Metadata Variables Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ansible-generator-guide.md Examples of using `ansible_var_*` for infrastructure metadata. ```ansible ansible_var_mac ansible_var_rack ansible_var_datacenter ansible_var_vlan ``` -------------------------------- ### Deeper Nesting Example Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/resource-levels.md Demonstrates deeper nesting by modeling a Docker container within a VM. ```bash rpk systems add gitea-container rpk systems set gitea-container --type container --runs-on docker-vm rpk services add gitea rpk services set gitea --runs-on gitea-container --port 3000 ``` -------------------------------- ### Build Commands Source: https://github.com/timmoth/rackpeek/blob/main/AGENTS.md Commands for building the project, including debug, release, CLI, and web builds. ```bash just build # dotnet build RackPeek.sln (Debug) just build-release # Release just build-cli # publish self-contained single-file binary (default linux-x64) just build-cli linux-arm64 # cross-target just build-web # docker build -t rackpeek:ci -f RackPeek.Web/Dockerfile . ``` -------------------------------- ### rpk systems get Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Retrieve a system by name. ```bash DESCRIPTION: Retrieve a system by name USAGE: rpk systems get [OPTIONS] ARGUMENTS: The name of the system OPTIONS: -h, --help Prints help information ``` -------------------------------- ### Full CLI Export Example Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ssh-config-export.md A comprehensive example of the `rpk export ssh` command with multiple options for filtering and setting defaults. ```bash rpk export ssh \ --include-tags prod,linux \ --default-user ubuntu \ --default-port 22 \ --default-identity ~/.ssh/id_rsa \ --output ssh_config ``` -------------------------------- ### rpk laptops get Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Retrieve a Laptop by name. ```bash DESCRIPTION: Retrieve a Laptop by name USAGE: rpk laptops get [OPTIONS] ARGUMENTS: OPTIONS: -h, --help Prints help information ``` -------------------------------- ### CLI Workflow Test Example Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/testing-guidelines.md An example of a C# integration test for the CLI, validating server and system additions, and tree output. ```csharp [Fact] public async Task servers_tree_cli_workflow_test() { await File.WriteAllTextAsync(Path.Combine(fs.Root, "config.yaml"), ""); var (output, yaml) = await ExecuteAsync("servers", "add", "node01"); Assert.Equal("Server 'node01' added.\n", output); Assert.Contains("name: node01", yaml); (output, yaml) = await ExecuteAsync("systems", "add", "host01"); Assert.Equal("System 'host01' added.\n", output); (output, yaml) = await ExecuteAsync("systems", "add", "host02"); Assert.Equal("System 'host02' added.\n", output); (output, yaml) = await ExecuteAsync("systems", "add", "host03"); Assert.Equal("System 'host03' added.\n", output); (output, yaml) = await ExecuteAsync( "systems", "set", "host01", "--runs-on", "node01" ); Assert.Equal("System 'host01' updated.\n", output); (output, yaml) = await ExecuteAsync("services", "add", "immich"); Assert.Equal("Service 'immich' added.\n", output); (output, yaml) = await ExecuteAsync("servers", "tree", "node01"); Assert.Equal(@"\n node01 ├── System: host01 │ ├── Service: immich │ └── Service: paperless ├── System: host02 └── System: host03 ", output); } ``` -------------------------------- ### Using Tags for Grouping Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ansible-generator-guide.md Example of using tags for simple grouping in Ansible inventory. ```yaml tags: - prod - web - ansible ``` -------------------------------- ### Page Object Model (POM) Example Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/testing-guidelines.md An example of an E2E test using the Page Object Model (POM) pattern in C# with Playwright. ```csharp [Fact] public async Task User_Can_Add_And_Delete_Desktop() { var (context, page) = await CreatePageAsync(); var resourceName = $"e2e-ap-{Guid.NewGuid():N}"[..16]; try { await page.GotoAsync(fixture.BaseUrl); var layout = new MainLayoutPom(page); await layout.AssertLoadedAsync(); await layout.GotoHardwareAsync(); var hardwarePage = new HardwareTreePom(page); await hardwarePage.AssertLoadedAsync(); await hardwarePage.GotoDesktopsListAsync(); var listPage = new DesktopsListPom(page); await listPage.AssertLoadedAsync(); await listPage.AddDesktopAsync(resourceName); await listPage.AssertDesktopExists(resourceName); await listPage.DeleteDesktopAsync(resourceName); await listPage.AssertDesktopDoesNotExist(resourceName); } catch (Exception) { _output.WriteLine("TEST FAILED — Capturing diagnostics"); _output.WriteLine($"Current URL: {page.Url}"); var html = await page.ContentAsync(); _output.WriteLine("==== DOM SNAPSHOT START ===="); _output.WriteLine(html); _output.WriteLine("==== DOM SNAPSHOT END ===="); throw; } finally { await context.CloseAsync(); } } ``` -------------------------------- ### Advanced Pattern Inventory Structure Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ansible-generator-guide.md Example of an inventory structure using 'env' and 'role' labels for advanced pattern matching. ```text env_prod env_staging role_web role_database ``` -------------------------------- ### Using Labels for Structured Groups Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ansible-generator-guide.md Example of using labels for structured and scalable grouping in Ansible inventory. ```yaml labels: env: prod role: database ``` -------------------------------- ### Release Command Source: https://github.com/timmoth/rackpeek/blob/main/AGENTS.md Command for pushing Docker images to a registry. ```bash just docker-push 1.3.2 # multi-arch (linux/amd64, linux/arm64) push to aptacode/rackpeek ``` -------------------------------- ### CLI Command Structure Source: https://github.com/timmoth/rackpeek/blob/main/AGENTS.md Illustrates the general structure of the RackPeek command-line interface commands, including kinds, verbs, and sub-commands. ```bash rpk [name] [flags] kinds: summary, servers, switches, routers, firewalls, systems, accesspoints, ups, desktops, laptops, services verbs: summary, add, list, get, describe, set, del, tree sub: cpu, drive, gpu, nic, port, subnets, labels, tags, rename, … ``` -------------------------------- ### rpk desktops get command Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/cli-commands.md Retrieves a desktop by name. ```bash DESCRIPTION: Retrieve a desktop by name USAGE: rpk desktops get [OPTIONS] ARGUMENTS: OPTIONS: -h, --help Prints help information ``` -------------------------------- ### Example Resource Configuration Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ssh-config-export.md A complete example of a resource definition including kind, type, name, tags, and labels for SSH configuration. ```yaml - kind: System type: vm name: vm-web01 tags: - prod - linux labels: ip: 192.168.1.20 ssh_user: ubuntu ``` -------------------------------- ### rpk desktops get command Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Retrieve a desktop by name. ```bash rpk desktops get [OPTIONS] ``` -------------------------------- ### Test Commands Source: https://github.com/timmoth/rackpeek/blob/main/AGENTS.md Commands for testing the project, including CLI tests, end-to-end tests, and a comprehensive test suite. ```bash just test-cli # fast CLI tests, no Docker required just e2e-setup # ONCE: installs Playwright CLI + browsers just test-e2e # implies build-web; runs Playwright suite just test-all # = build-web + e2e-setup + test-cli + test-e2e just ci # alias for test-all — matches the pre-PR checklist ``` -------------------------------- ### Resource Naming Convention Example Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ssh-config-export.md Illustrates how resource names are transformed into valid SSH host aliases. ```ssh Host vm-web-01 ``` -------------------------------- ### rpk laptops add Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Add a new Laptop. ```bash DESCRIPTION: Add a new Laptop USAGE: rpk laptops add [OPTIONS] ARGUMENTS: OPTIONS: -h, --help Prints help information ``` -------------------------------- ### RackPeek Solution Layout Source: https://github.com/timmoth/rackpeek/blob/main/AGENTS.md The directory structure of the RackPeek project, outlining the purpose of each directory and its key components. ```tree RackPeek.sln ├── RackPeek/ CLI entry point (Spectre.Console.Cli) → produces `rpk` ├── RackPeek.Domain/ Core domain: resources, use-cases, persistence, git │ ├── Resources/ Resource models (Server, Switch, System, Service, …) │ ├── UseCases/ Generic use-cases (Add, Delete, Rename, Cpus, Drives, Gpus, Ports, Labels, Tags, Ansible, SSH, Hosts) │ ├── Persistence/ IResourceCollection, Yaml repositories, migrations │ │ └── Yaml/ YamlResourceCollection, RackPeekConfigMigrationDeserializer, ResourceYamlMigrationService │ ├── Git/ Optional LibGit2Sharp integration (NullGitRepository when disabled) │ ├── Api/ InventoryRequest/Response + UpsertInventoryUseCase (used by Web API) │ └── ServiceCollectionExtensions.cs DI: AddUseCases / AddYamlRepos / AddGitServices ├── Shared.Rcl/ Razor Class Library: Blazor components AND CLI command wiring shared between Web + CLI │ ├── Commands/ Spectre.Console.Cli command classes (one folder per resource kind) │ ├── Components/ Shared Razor components │ ├── Modals/, Layout/, Services/, Console/ │ ├── CliBootstrap.cs Registers all CLI commands + DI internals (single source of truth for the `rpk` command tree) │ └── ConsoleRunner.cs Lets the Web UI execute CLI commands in-process ├── RackPeek.Web/ Blazor Server host (Dockerfile lives here) ├── RackPeek.Web.Viewer/ Blazor WebAssembly viewer (powers the github-pages demo) ├── Tests/ CLI integration tests (xUnit) — fast, no Docker │ ├── EndToEnd/ Per-resource workflow tests using the real CLI │ ├── Api/ Web API endpoint tests (Microsoft.AspNetCore.Mvc.Testing) │ ├── TestConfigs/v1,v2,v3/ Fixture YAML files for migration tests │ └── schemas/ JSON schemas validated against output └── Tests.E2e/ Playwright + Testcontainers — spins up the Docker image and drives the Web UI ├── PageObjectModels/ One POM per page/component (required pattern) └── Infra/PlaywrightFixture.cs Container + browser lifecycle ``` -------------------------------- ### rpk laptops list Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md List all Laptops. ```bash DESCRIPTION: List all Laptops USAGE: rpk laptops list [OPTIONS] OPTIONS: -h, --help Prints help information ``` -------------------------------- ### Generated Inventory with Custom Variables Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ansible-generator-guide.md Example of how custom variables are exposed in the generated inventory. ```yaml cerberus-0: ansible_host: 10.0.0.10 mac: 52:54:00:11:22:33 rack: rack01 ``` -------------------------------- ### rpk laptops summary Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Show a summarized hardware report for all Laptops. ```bash DESCRIPTION: Show a summarized hardware report for all Laptops USAGE: rpk laptops summary [OPTIONS] OPTIONS: -h, --help Prints help information ``` -------------------------------- ### rpk laptops tree Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Display the dependency tree for a Laptop. ```bash DESCRIPTION: Display the dependency tree for a Laptop USAGE: rpk laptops tree [OPTIONS] ARGUMENTS: OPTIONS: -h, --help Prints help information ``` -------------------------------- ### rpk laptops describe Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Show detailed information about a Laptop. ```bash DESCRIPTION: Show detailed information about a Laptop USAGE: rpk laptops describe [OPTIONS] ARGUMENTS: OPTIONS: -h, --help Prints help information ``` -------------------------------- ### Fix Docker Bind Mount Ownership Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/install-guide.md Command to fix ownership issues when using a bind mount for the RackPeek configuration directory. ```bash sudo chown -R 1000:1000 /path/on/host/rackpeek ``` -------------------------------- ### rpk laptops cpu add Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Add a CPU to a Laptop. ```bash DESCRIPTION: Add a CPU to a Laptop USAGE: rpk laptops cpu add [OPTIONS] ARGUMENTS: The Laptop name OPTIONS: -h, --help Prints help information --model The model name --cores The number of cpu cores --threads The number of cpu threads ``` -------------------------------- ### Example Resource Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/hosts-file-export.md An example of a resource definition that includes an IP label. ```yaml - kind: System name: vm-web01 tags: - prod labels: ip: 192.168.1.20 ``` -------------------------------- ### rpk desktops nic add Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Add a NIC to a desktop. ```bash DESCRIPTION: Add a NIC to a desktop USAGE: rpk desktops nic add [OPTIONS] ARGUMENTS: The desktop name OPTIONS: -h, --help Prints help information --type The nic port type e.g rj45 / sfp+ --speed The port speed --ports The number of ports ``` -------------------------------- ### Final SSH Config Output Example Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ssh-config-export.md An example of a complete `~/.ssh/config` file generated by RackPeek for multiple resources. ```ssh Host vm-db01 HostName 192.168.1.30 User postgres Port 2222 IdentityFile ~/.ssh/id_rsa Host vm-web01 HostName 192.168.1.20 User ubuntu IdentityFile ~/.ssh/id_rsa ``` -------------------------------- ### rpk desktops describe command Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Show detailed information about a desktop. ```bash rpk desktops describe [OPTIONS] ``` -------------------------------- ### rpk desktops describe command Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/cli-commands.md Shows detailed information about a desktop. ```bash DESCRIPTION: Show detailed information about a desktop USAGE: rpk desktops describe [OPTIONS] ARGUMENTS: OPTIONS: -h, --help Prints help information ``` -------------------------------- ### rpk services list Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/cli-commands.md List all services. ```bash DESCRIPTION: List all services USAGE: rpk services list [OPTIONS] OPTIONS: -h, --help Prints help information ``` -------------------------------- ### rpk desktops add command Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Add a new desktop. ```bash rpk desktops add [OPTIONS] ``` -------------------------------- ### Common Workflows - Rebuild and Test Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/dev-cheat-sheet.md Quickly rebuild the web image and run end-to-end tests. ```bash docker build -t rackpeek:ci -f RackPeek.Web/Dockerfile . cd Tests.E2e && dotnet test ``` -------------------------------- ### rpk services get command Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Command to retrieve a service by name. ```bash DESCRIPTION: Retrieve a service by name USAGE: rpk services get [OPTIONS] ARGUMENTS: The name of the service OPTIONS: -h, --help Prints help information ``` -------------------------------- ### rpk ups get command Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Retrieve a UPS unit by name. ```bash rpk ups get [OPTIONS] ``` -------------------------------- ### Build & Push Multi-Arch Docker Image Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/dev-cheat-sheet.md Perform a manual release build for multi-architecture Docker images and push them to the registry. ```bash docker buildx build \ --platform linux/amd64,linux/arm64 \ -f ./Dockerfile \ -t aptacode/rackpeek:v0.0.11 \ -t aptacode/rackpeek:latest \ --push .. ``` -------------------------------- ### rpk accesspoints get command Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Retrieve an access point by name. ```bash rpk accesspoints get [OPTIONS] ``` -------------------------------- ### Run CLI Tests Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/testing-guidelines.md Command to navigate to the tests directory and run CLI tests. ```bash cd Tests dotnet test ``` -------------------------------- ### rpk Laptops get command Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/cli-commands.md Command to retrieve a Laptop by name. ```bash DESCRIPTION: Retrieve a Laptop by name USAGE: rpk Laptops get [OPTIONS] ARGUMENTS: OPTIONS: -h, --help Prints help information ``` -------------------------------- ### rpk ups get command Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/cli-commands.md Retrieves a UPS unit by name. ```bash DESCRIPTION: Retrieve a UPS unit by name USAGE: rpk ups get [OPTIONS] ARGUMENTS: OPTIONS: -h, --help Prints help information ``` -------------------------------- ### rpk accesspoints get command Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/cli-commands.md Retrieves an access point by name. ```bash DESCRIPTION: Retrieve an access point by name USAGE: rpk accesspoints get [OPTIONS] ARGUMENTS: The access point name OPTIONS: -h, --help Prints help information ``` -------------------------------- ### rpk desktops summary command Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/cli-commands.md Shows a summarized hardware report for all desktops. ```bash DESCRIPTION: Show a summarized hardware report for all desktops USAGE: rpk desktops summary [OPTIONS] OPTIONS: -h, --help Prints help information ``` -------------------------------- ### rpk switches get Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Retrieve details of a specific switch by name. ```bash DESCRIPTION: Retrieve details of a specific switch by name USAGE: rpk switches get [OPTIONS] ARGUMENTS: OPTIONS: -h, --help Prints help information ``` -------------------------------- ### rpk desktops summary command Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Shows a summarized hardware report for all desktops. ```bash DESCRIPTION: Show a summarized hardware report for all desktops USAGE: rpk desktops summary [OPTIONS] OPTIONS: -h, --help Prints help information ``` -------------------------------- ### rpk firewalls get command Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Retrieve details of a specific firewall by name. ```bash DESCRIPTION: Retrieve details of a specific firewall by name USAGE: rpk firewalls get [OPTIONS] ARGUMENTS: OPTIONS: -h, --help Prints help information ``` -------------------------------- ### Build CLI (macOS ARM64) Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/dev-cheat-sheet.md Publish a self-contained single binary for macOS ARM64. ```bash dotnet publish -c Release -r osx-arm64 \ --self-contained true \ -p:PublishSingleFile=true ``` ```bash sudo mv bin/Release/net*/osx-arm64/publish/RackPeek /usr/local/bin/rpk sudo chmod +x /usr/local/bin/rpk ``` ```bash rpk --help ``` -------------------------------- ### rpk desktops list command Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md List all desktops. ```bash rpk desktops list [OPTIONS] ``` -------------------------------- ### rpk routers get command Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Retrieve details of a specific router by name. ```bash DESCRIPTION: Retrieve details of a specific router by name USAGE: rpk routers get [OPTIONS] ARGUMENTS: OPTIONS: -h, --help Prints help information ``` -------------------------------- ### rpk systems list Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md List all systems. ```bash DESCRIPTION: List all systems USAGE: rpk systems list [OPTIONS] OPTIONS: -h, --help Prints help information ``` -------------------------------- ### rpk switches get command Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/cli-commands.md Retrieves details of a specific network switch by name. ```bash DESCRIPTION: Retrieve details of a specific switch by name USAGE: rpk switches get [OPTIONS] ARGUMENTS: OPTIONS: -h, --help Prints help information ``` -------------------------------- ### rpk systems describe Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Display detailed information about a system. ```bash DESCRIPTION: Display detailed information about a system USAGE: rpk systems describe [OPTIONS] ARGUMENTS: The name of the system OPTIONS: -h, --help Prints help information ``` -------------------------------- ### rpk servers get command usage Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Usage and options for retrieving server information. ```bash DESCRIPTION: List all servers or retrieve a specific server by name USAGE: rpk servers get [OPTIONS] ARGUMENTS: OPTIONS: -h, --help Prints help information ``` -------------------------------- ### Set Runs-On Relationship (CLI) Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/resource-levels.md Examples of setting the 'runs-on' relationship for systems and services using the CLI. ```bash rpk systems set my-vm --runs-on proxmox-ve rpk services set gitea --runs-on docker-host ``` ```bash rpk systems set my-vm --runs-on proxmox-ve --runs-on proxmox-ve-02 ``` -------------------------------- ### rpk desktops gpu add command Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/cli-commands.md Adds a GPU to a desktop. ```bash DESCRIPTION: Add a GPU to a desktop USAGE: rpk desktops gpu add [OPTIONS] ARGUMENTS: The name of the desktop OPTIONS: -h, --help Prints help information --model The Gpu model --vram The amount of gpu vram in Gb ``` -------------------------------- ### rpk desktops gpu add command Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Adds a GPU to a desktop. ```bash DESCRIPTION: Add a GPU to a desktop USAGE: rpk desktops gpu add [OPTIONS] ARGUMENTS: The name of the desktop OPTIONS: -h, --help Prints help information --model The Gpu model --vram The amount of gpu vram in Gb ``` -------------------------------- ### Generated SSH Config Example Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ssh-config-export.md Shows the resulting SSH configuration block generated for a resource. ```ssh Host vm-web01 HostName 192.168.1.20 User ubuntu IdentityFile ~/.ssh/id_rsa ``` -------------------------------- ### rpk laptops cpu Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Manage CPUs attached to Laptops. ```bash DESCRIPTION: Manage CPUs attached to Laptops USAGE: rpk laptops cpu [OPTIONS] OPTIONS: -h, --help Prints help information COMMANDS: add Add a CPU to a Laptop set Update a Laptop CPU del Remove a CPU from a Laptop ``` -------------------------------- ### Alternative Labels for ansible_host Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ansible-generator-guide.md Alternative labels that RackPeek accepts if 'ansible_host' is not provided. ```yaml labels: ip: 192.168.1.10 ``` -------------------------------- ### Required Label Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ansible-generator-guide.md Minimum required label for a resource to be considered an Ansible host. ```yaml labels: ansible_host: 192.168.1.10 ``` -------------------------------- ### Generate Services to Stdout Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/docker-gen-guide.md Command to run docker compose and output generated services to stdout. ```bash docker compose up --no-log-prefix ``` -------------------------------- ### Add VMs and Containers Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/resource-levels.md Adds VMs and containers running on the hypervisor. ```bash rpk systems add media-vm rpk systems set media-vm --type vm --os "Ubuntu 24.04" --cores 4 --ram 8 --runs-on proxmox-ve rpk systems add docker-vm rpk systems set docker-vm --type vm --os "Debian 12" --cores 8 --ram 16 --runs-on proxmox-ve rpk systems add pihole-lxc rpk systems set pihole-lxc --type container --os "Alpine 3.21" --cores 1 --ram 512 --runs-on proxmox-ve ``` -------------------------------- ### rpk systems Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Manage systems and their dependencies. ```bash DESCRIPTION: Manage systems and their dependencies USAGE: rpk systems [OPTIONS] OPTIONS: -h, --help Prints help information COMMANDS: summary Show a summary report for all systems add Add a new system to the inventory list List all systems get Retrieve a system by name describe Display detailed information about a system set Update properties of a system del Delete a system from the inventory tree Display the dependency tree for a system ``` -------------------------------- ### rpk desktops add command Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/cli-commands.md Adds a new desktop. ```bash DESCRIPTION: Add a new desktop USAGE: rpk desktops add [OPTIONS] ARGUMENTS: OPTIONS: -h, --help Prints help information ``` -------------------------------- ### rpk desktops list command Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/cli-commands.md Lists all desktops. ```bash DESCRIPTION: List all desktops USAGE: rpk desktops list [OPTIONS] OPTIONS: -h, --help Prints help information ``` -------------------------------- ### Determine Ubuntu Kernel Version Source: https://github.com/timmoth/rackpeek/blob/main/docs/development/dev-setup.md Exports the detected Ubuntu kernel version to a variable for use in subsequent commands. ```shell export RACKPEEK_KERNEL_VERSION=$(dpkg -l | grep linux-image | grep ii | head -1 | awk '{print $3}' | sed 's/.*~\([0-9]*\.[0-9]*\)\..*/\1/') ``` -------------------------------- ### rpk laptops Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Manage Laptop computers and their components. ```bash DESCRIPTION: Manage Laptop computers and their components USAGE: rpk laptops [OPTIONS] OPTIONS: -h, --help Prints help information COMMANDS: add Add a new Laptop list List all Laptops get Retrieve a Laptop by name describe Show detailed information about a Laptop del Delete a Laptop from the inventory summary Show a summarized hardware report for all Laptops tree Display the dependency tree for a Laptop cpu Manage CPUs attached to Laptops drive Manage storage drives attached to Laptops gpu Manage GPUs attached to Laptops ``` -------------------------------- ### rpk accesspoints add Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Add a new access point. ```bash DESCRIPTION: Add a new access point USAGE: rpk accesspoints add [OPTIONS] ARGUMENTS: The access point name OPTIONS: -h, --help Prints help information ``` -------------------------------- ### CLI Command for Filtering by Tags Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ssh-config-export.md An example CLI command to export SSH configurations, including only resources tagged with 'prod'. ```bash rpk export ssh --include-tags prod ``` -------------------------------- ### rpk services Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/cli-commands.md Manage services and their configurations. Supports commands for summary, add, list, get, describe, set, del, and subnets. ```bash DESCRIPTION: Manage services and their configurations USAGE: rpk services [OPTIONS] OPTIONS: -h, --help Prints help information COMMANDS: summary Show a summary report for all services add Add a new service list List all services get Retrieve a service by name describe Show detailed information about a service set Update properties of a service del Delete a service subnets List subnets associated with a service, optionally filtered by CIDR ``` -------------------------------- ### rpk routers summary Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Show a hardware report for all routers. ```bash DESCRIPTION: Show a hardware report for all routers USAGE: rpk routers summary [OPTIONS] OPTIONS: -h, --help Prints help information ``` -------------------------------- ### rpk switches describe Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Show detailed information about a switch. ```bash DESCRIPTION: Show detailed information about a switch USAGE: rpk switches describe [OPTIONS] ARGUMENTS: OPTIONS: -h, --help Prints help information ``` -------------------------------- ### rpk accesspoints summary Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md Show a hardware report for all access points. ```bash DESCRIPTION: Show a hardware report for all access points USAGE: rpk accesspoints summary [OPTIONS] OPTIONS: -h, --help Prints help information ``` -------------------------------- ### Web UI Inventory Generation Settings Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/ansible-generator-guide.md Settings available in the Web UI for generating Ansible inventory. ```text /ansible/inventory Set: * Group By Tags * Group By Labels * Global Variables Click **Generate**. ``` -------------------------------- ### rpk switches list Source: https://github.com/timmoth/rackpeek/blob/main/docs/Commands.md List all switches in the system. ```bash DESCRIPTION: List all switches in the system USAGE: rpk switches list [OPTIONS] OPTIONS: -h, --help Prints help information ``` -------------------------------- ### rpk Laptops add command Source: https://github.com/timmoth/rackpeek/blob/main/Shared.Rcl/wwwroot/raw_docs/cli-commands.md Command to add a new Laptop. ```bash DESCRIPTION: Add a new Laptop USAGE: rpk Laptops add [OPTIONS] ARGUMENTS: OPTIONS: -h, --help Prints help information ```