PhilippTheServer

infrastructure-as-code

Keeping the repository, not the machine, as the source of truth about a system.

  1. The Whole Estate in One Article: How Every Layer Fits Together

    Self-hosted platform build order: why mesh, cluster, Ceph storage, identity and observability must precede model serving, shown with Compose depends_on.

  2. Testing Infrastructure Code by Executing Its Real Expressions

    Ansible Templar in pytest: render the shipped combine(recursive=True) expression from defaults/main.yml instead of a shallow Python paraphrase.

  3. Runtime Configuration for an Angular Container Without Rebuilding

    Angular environment.ts is baked in at ng build. Load config.json via APP_INITIALIZER, generated by envsubst in /docker-entrypoint.d at container start.

  4. Building the Dry-Run Path First, and Testing That It Sends Nothing

    if dry_run: return guards drift as side effects are added. Split the tool into a pure plan() and apply(), and test that dry run never calls the client.

  5. A Single-Writer Rule for Configuration Held in Redis

    SET NX PX lease plus a Lua script that checks the fencing token, bumps a version and publishes, so exactly one process writes a Redis config key.

  6. Infrastructure as Code with Ansible: Making a Host Reproducible from the Repository

    ansible-playbook --check --diff and a changed=0 second run as proof a host matches its repository, with a container demo that corrects a hand edit.

  7. Managing a Shared DNS Zone Through a Replace-Everything API

    PUT /zone replaces the whole DNS zone: a read-merge-write client with owner TXT records that keeps unmanaged records and removes stale managed ones.

  8. Provisioning a Single-Board Computer as an Industrial Edge Node

    /proc/device-tree/model read by Ansible to load board-revision vars via include_vars with_first_found, with a generic fallback and a container test.

  9. Configuration Precedence: Docker Secrets, Kubernetes Secrets, Environment, .env, Default

    Docker secrets in /run/secrets, Kubernetes secret mounts, env vars and .env: a Python resolver with fixed precedence that reports which source won.

  10. Deploying Docker Compose from Ansible Without Shelling Out

    community.docker.docker_compose_v2 instead of a command task running docker compose up -d: real changed status and --check --diff support.

  11. Ansible Role Idempotence: Why a changed=0 Run Is the Only Proof You Have

    Molecule "Idempotence test failed because of the following tasks": why command, shell and timestamped templates report changed, and how to fix it.

  12. Migrating the SSH Port Mid-Playbook Without Locking Ansible Out

    Ansible meta: reset_connection after changing the sshd Port: validate with sshd -t, flush_handlers, and ping before closing the old port.

All topics · All writing