From c409e38d4e396b82c921d275133863df773cdf95 Mon Sep 17 00:00:00 2001 From: Vincent Stuyck Date: Tue, 27 Oct 2026 09:03:36 +0100 Subject: [PATCH] Update CLAUDE.md --- CLAUDE.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 9d00b6c..53d224c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## What this is -Ansible playbooks for a homelab: Ubuntu VMs on a Proxmox host (`rimeru`), a TrueNAS box (`veldora`), and a Checkmk monitoring server (`shion`). There are no roles and no `ansible.cfg`. Everything is a standalone playbook in `playbooks/`. The README is the generic Ansible best-practices template and doesn't describe this repo. +Ansible playbooks for a homelab: Ubuntu VMs on a Proxmox host (`rimeru`), a TrueNAS box (`veldora`), and a Checkmk monitoring server (`shion`). There are no roles and no `ansible.cfg`. Everything is a standalone playbook in `playbooks/`. `README.md` is the human-facing overview: setup, the playbook table, and the steps for adding a host. ## Setup and commands @@ -29,14 +29,14 @@ The `# noqa:` annotations in the playbooks are for ansible-lint (`ansible-lint p ## Inventory layout - `inventory/homelab` holds the infrastructure groups: `ubuntu` (all Ubuntu VMs), `docker`, `kubernetes`, `proxmox`, `truenas`. -- `inventory/monitoring` holds the Checkmk groups: `sites` (Checkmk servers) and `agents` (hosts that run the Checkmk agent). When you add a host to the homelab, it usually also goes into `agents` (see the recent commits). +- `inventory/monitoring` holds the Checkmk groups: `sites` (Checkmk servers) and `agents` (hosts that run the Checkmk agent). When you add a host to the homelab, it usually also goes into `agents` (see README for the full steps). - `inventory/group_vars/all/` holds the API connection vars for both Proxmox and Checkmk (`servers.yml`) plus `vault.yml`, which is Ansible Vault–encrypted and holds the matching secrets (`proxmox_api_token_secret`, `checkmk_api_secret`). They live under `all` (not `sites`) so the `ubuntu` hosts in `update-debian.yml` can reach the Checkmk API vars too. Secrets go in vault files, not inline in playbooks. - `inventory/host_vars/.yml` for a Checkmk server sets `checkmk_sites` (the list of OMD site names to manage) and `vmid`. No playbook reads `vmid` yet. The snapshot task finds the VM by name instead. ## Playbook notes - `update-checkmk.yml` has three plays that share state through a fact: - 1. On `localhost`, it gets the latest stable Checkmk tag from GitHub with `git ls-remote` and sets `checkmk_version`. A `set_fact` only applies to the hosts in its own play, so later plays only see the fact if this play covers their hosts too (as `hosts: all` plus `delegate_to: localhost` did) or if they read it as `hostvars['localhost'].checkmk_version`. + 1. On `all` hosts, delegated to localhost, it gets the latest stable Checkmk tag from GitHub with `git ls-remote` and sets `checkmk_version`. It targets `all` on purpose: a `set_fact` only applies to the hosts in its own play, so `sites` and `agents` would lose the fact if the play ran only on `localhost` (or they'd have to read `hostvars['localhost'].checkmk_version`). 2. On `sites`, it snapshots the VM through the Proxmox API (delegated to localhost, using `inventory_hostname_short` as the Proxmox VM name), installs the community-edition `.deb`, then runs `omd stop`, `backup`, `update` and `start` for each entry in `checkmk_sites`. 3. On `agents`, it installs the agent `.deb` from the local Checkmk server (`checkmk.stuyckv.com/local`).