# 02 - Configuring the Inventory One inventory folder per customer or cluster. Never mix multiple clusters in a single inventory — variables are global within an inventory and will cross-contaminate. ## 1. Create the Inventory ```bash cp -r inventories/_template inventories/ ``` The template contains two files to fill in: ``` inventories// ├── hosts.ini └── group_vars/all.yml ``` ## 2. Configure hosts.ini Each line defines one node. The inventory alias (left-hand label) is used by Ansible internally and does not need to match the real system hostname — Proxmox and Linstor operations always use the actual hostname gathered from the node at runtime. ```ini [proxmox] pve-node-01 ansible_host=192.168.1.1 priv_ip=10.0.0.1 priv_nic_1=enp2s0 priv_nic_2=enp3s0 pve-node-02 ansible_host=192.168.1.2 priv_ip=10.0.0.2 priv_nic_1=enp2s0 priv_nic_2=enp3s0 pve-node-03 ansible_host=192.168.1.3 priv_ip=10.0.0.3 priv_nic_1=enp1s0 priv_nic_2=enp4s0 ``` | Variable | Required | Description | |---|---|---| | `ansible_host` | Yes | Management IP — used for SSH and Proxmox GUI | | `priv_ip` | No | Private IP for Corosync and DRBD replication. Falls back to `ansible_host` if omitted | | `priv_nic_1` / `priv_nic_2` | No | The two NICs forming the p2p bridge. Required only when running `network.yml`. NIC names can differ per node — check with `ip link show` | | `pve_enterprise_key` | No | Per-node Proxmox subscription key. If omitted, the node uses the no-subscription repository | **Single-node example** (no cluster, no Linstor): ```ini [proxmox] pve-standalone ansible_host=10.0.0.50 ``` ## 3. Configure group_vars/all.yml ### Deployment Toggles | Variable | Default | Description | |---|---|---| | `standalone_mode` | `false` | Skip all clustering and Linstor tasks, even with multiple nodes in inventory | | `deploy_linstor` | `false` | Install and configure Linstor + DRBD. Requires 3+ nodes and `standalone_mode: false` | | `disable_ipv6` | `false` | Disable IPv6 system-wide via sysctl. Useful when IPv6 is unrouted and causes connection timeouts | | `wipe_linstor_disks` | `false` | Wipe partition tables and signatures from raw block devices before LVM creation. **Destructive — only set on first deployment** | ### Proxmox Cluster ```yaml pve_cluster_name: "my-cluster" # pve_enterprise_key: "" # Optional global key; prefer per-host in hosts.ini ``` ### Linstor HA Controller ```yaml ha_pool: "fast_pool_1" # Storage pool used for the linstor_db HA volume ha_vip: "10.0.0.10" # Floating VIP managed by drbd-reactor ha_vip_cidr: "24" # Prefix length — also used for the p2p bridge address ``` ### Linstor Storage Pools Each entry defines one Resource Group. All nodes in a pool share the same `pool_name`. Keys under `targets` must match the inventory alias from `hosts.ini`. ```yaml linstor_storage_pools: - pool_name: "fast_pool_1" rg_name: "fast_pool_1" vg_name: "pve" thin_name: "data" targets: pve-node-01: "pve/data" # Register existing pve/data thin pool (no disk changes) pve-node-02: "pve/data" pve-node-03: "pve/data" - pool_name: "slow_pool_1" rg_name: "slow_pool_1" vg_name: "sp1" thin_name: "data" targets: pve-node-01: "/dev/sdb" # Create VG sp1 + thin pool on /dev/sdb pve-node-02: "/dev/sdb" pve-node-03: "/dev/sdb" ``` **Target path rules:** - `/dev/...` — playbook creates the VG and LVM thin pool on that raw device. If `wipe_linstor_disks: true`, the disk is wiped first with `wipefs` and `sgdisk`. - `vg_name/thin_name` (e.g. `pve/data`) — playbook registers the existing thin pool directly in Linstor without touching the underlying storage. --- [Previous: Prerequisites](01-prerequisites.md) | [Index](../README.md) | [Next: Running the Playbooks](03-execution.md)