43 lines
2.0 KiB
Markdown
43 lines
2.0 KiB
Markdown
# 02 - Configuring the Cluster (or Nodes)
|
|
|
|
Configurations are segmented per project/customer using isolated Ansible inventories. **Best Practice:** One customer (or one logical cluster) equals one inventory folder. Do not attempt to define multiple clusters within a single inventory to prevent cross-contamination (the "Blast Radius").
|
|
|
|
## 1. Create the Environment
|
|
Copy the template directory for your specific project:
|
|
|
|
```bash
|
|
cp -r inventories/_template inventories/<customer_name>
|
|
mv inventories/<customer_name>/hosts.yml.example inventories/<customer_name>/hosts.yml
|
|
mv inventories/<customer_name>/group_vars/all.yml.example inventories/<customer_name>/group_vars/all.yml
|
|
```
|
|
|
|
## 2. Configure `hosts.yml` (Topology & Licensing)
|
|
Define the target PVE nodes. Ansible defaults to the `ansible_host` IP for Corosync/DRBD. If a dedicated backend network is available, define `priv_ip`.
|
|
|
|
**Licensing:** Proxmox licenses are socket/node-specific. Insert the `pve_enterprise_key` directly under each host. If a node lacks a key, omit the variable entirely; Ansible will fall back to the `pve-no-subscription` repository automatically for that specific node.
|
|
|
|
```yaml
|
|
all:
|
|
children:
|
|
proxmox:
|
|
hosts:
|
|
pve-node-01:
|
|
ansible_host: 192.168.1.11
|
|
priv_ip: 10.0.0.11
|
|
pve_enterprise_key: "pve1c-111111111111"
|
|
pve-node-02:
|
|
ansible_host: 192.168.1.12
|
|
priv_ip: 10.0.0.12
|
|
# Omitted key: This node will use no-subscription
|
|
```
|
|
|
|
## 3. Configure `group_vars/all.yml`
|
|
|
|
* **Deployment Toggles:**
|
|
* `deploy_linstor: true` (Provisions HCI/DRBD stack)
|
|
* `standalone_mode: false` (Set to `true` if you are provisioning independent, unclustered servers).
|
|
* **HA Controller:** Define `ha_pool`, `ha_vip` (Virtual IP), and the CIDR prefix for the Linstor DB promoter.
|
|
* **Storage Pools:**
|
|
* If mapping a raw disk (`/dev/sda`), the playbook invokes `community.general.lvg` to create the VG/Thin Pool.
|
|
* If mapping an existing path (`pve/data`), LVM tasks are skipped, and the target is registered directly in Linstor.
|