Refactoring + final touches
This commit is contained in:
70
ansible/inventories/_template/group_vars/all.yml
Normal file
70
ansible/inventories/_template/group_vars/all.yml
Normal file
@@ -0,0 +1,70 @@
|
||||
---
|
||||
# ============================================================
|
||||
# Proxmox Post-Install - Group Variables Template
|
||||
# Copy this to your inventory folder as group_vars/all.yml
|
||||
# ============================================================
|
||||
|
||||
# --- Deployment Toggles ---
|
||||
# standalone_mode: Set to true to skip ALL cluster and Linstor tasks,
|
||||
# even when the inventory contains multiple nodes (useful for independent nodes per customer).
|
||||
standalone_mode: false
|
||||
|
||||
# deploy_linstor: Set to true to install and configure Linstor + DRBD storage.
|
||||
# Requires at least 3 nodes and standalone_mode: false.
|
||||
deploy_linstor: false
|
||||
|
||||
# disable_ipv6: Set to true to disable IPv6 system-wide via sysctl.
|
||||
# Useful when IPv6 is unrouted and causes connection timeouts (e.g. apt, curl).
|
||||
disable_ipv6: false
|
||||
|
||||
# wipe_linstor_disks: Set to true to wipe partition tables and signatures from raw block devices
|
||||
# before creating LVM VGs. Only affects targets defined as /dev/... paths.
|
||||
# WARNING: destructive — only set on first deployment, never on a running cluster.
|
||||
wipe_linstor_disks: false
|
||||
|
||||
# --- Proxmox Cluster ---
|
||||
pve_cluster_name: "example-cluster"
|
||||
# pve_enterprise_key: "" # Optional: global key (prefer per-host key in hosts.ini)
|
||||
|
||||
# --- Linstor / LINBIT Repository ---
|
||||
# Auto-calculated as: Debian major version - 4 (e.g. Debian 13 = proxmox-9).
|
||||
# Override manually if LINBIT publishes a differently-named repo for new Proxmox versions.
|
||||
# linbit_proxmox_version: 9
|
||||
|
||||
# --- Linstor HA Controller ---
|
||||
# ha_pool: Name of the Linstor storage pool to use for the controller HA volume.
|
||||
ha_pool: "fast_pool_1"
|
||||
# ha_vip: Virtual IP that follows the active Linstor controller across nodes.
|
||||
ha_vip: "192.168.2.4"
|
||||
# ha_vip_cidr: Prefix length for the VIP address (e.g. 24 for /24).
|
||||
ha_vip_cidr: "24"
|
||||
|
||||
# --- Linstor Storage Pools ---
|
||||
# Each entry defines one Resource Group, composed of one storage pool per node.
|
||||
# All pools in the same entry share the same pool_name across nodes.
|
||||
#
|
||||
# TARGET RULES:
|
||||
# - Use a raw block device path (/dev/sdb) to auto-create VG + LVM Thin Pool.
|
||||
# - Use an existing thin-pool path (vg_name/thin_name, e.g. "pve/data") to register
|
||||
# an already-existing LVM thin pool WITHOUT touching existing data.
|
||||
#
|
||||
# Keys under "targets" must match the Ansible inventory_hostname of each node
|
||||
# (i.e. the left-hand label in hosts.ini, e.g. "pve-node-01").
|
||||
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
|
||||
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" # Format /dev/sdb as VG sp1 + thin pool data
|
||||
pve-node-02: "/dev/sdb"
|
||||
pve-node-03: "/dev/sdb"
|
||||
@@ -1,37 +0,0 @@
|
||||
---
|
||||
# Deployment Toggles
|
||||
standalone_mode: true # Set to true to bypass all Corosync/Linstor tasks for independent nodes
|
||||
deploy_linstor: false # Set to true to install and configure Linstor/DRBD
|
||||
|
||||
# Proxmox Cluster Configuration
|
||||
pve_cluster_name: "example-cluster"
|
||||
|
||||
# High Availability Controller Configuration
|
||||
ha_pool: "fast_pool_1"
|
||||
ha_vip: "192.168.2.4"
|
||||
ha_vip_cidr: "29"
|
||||
|
||||
# Linstor Storage Pools Configuration
|
||||
# You can add or remove pools as needed
|
||||
|
||||
# TARGET RULES:
|
||||
# Use raw disk (/dev/sdb) to wipe/create LVM
|
||||
# Use existing thin-pool path (pve/data) to register safely (data won't be deleted)
|
||||
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"
|
||||
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/sda"
|
||||
pve-node-02: "/dev/sda"
|
||||
pve-node-03: "/dev/sda"
|
||||
25
ansible/inventories/_template/hosts.ini
Normal file
25
ansible/inventories/_template/hosts.ini
Normal file
@@ -0,0 +1,25 @@
|
||||
# ============================================================
|
||||
# Proxmox Cluster Inventory - INI Format
|
||||
# Copy this file to your inventory folder as "hosts.ini"
|
||||
# and adjust IPs, hostnames, and optional keys.
|
||||
# ============================================================
|
||||
|
||||
[proxmox]
|
||||
# Format: <inventory_alias> ansible_host=<management_ip> [priv_ip=<cluster_ip>] [priv_nic_1=<nic>] [priv_nic_2=<nic>] [pve_enterprise_key=<key>]
|
||||
#
|
||||
# - inventory_alias : Arbitrary label used by Ansible. Does NOT need to match the real hostname.
|
||||
# The real system hostname (ansible_hostname) is used for Proxmox & Linstor nodes.
|
||||
# - ansible_host : IP used by Ansible to SSH into the node (management/public IP).
|
||||
# - priv_ip : IP used for Corosync cluster traffic and Linstor replication (private/dedicated NIC).
|
||||
# If omitted, ansible_host is used as fallback.
|
||||
# - priv_nic_1/2 : (Optional) The two NICs forming the full-mesh p2p bridge (named "p2p").
|
||||
# Required only when running network.yml to configure the private bridge.
|
||||
# NIC names differ per node — check with: ip link show
|
||||
# - pve_enterprise_key : (Optional) Per-node Proxmox enterprise subscription key.
|
||||
|
||||
pve-node-01 ansible_host=192.168.1.1 priv_ip=192.168.2.1 priv_nic_1=enp2s0 priv_nic_2=enp3s0
|
||||
pve-node-02 ansible_host=192.168.1.2 priv_ip=192.168.2.2 priv_nic_1=enp2s0 priv_nic_2=enp3s0
|
||||
pve-node-03 ansible_host=192.168.1.3 priv_ip=192.168.2.3 priv_nic_1=enp2s0 priv_nic_2=enp3s0
|
||||
|
||||
# Single-node example (no cluster, no Linstor):
|
||||
# pve-standalone ansible_host=10.0.0.50
|
||||
@@ -1,16 +0,0 @@
|
||||
all:
|
||||
children:
|
||||
proxmox:
|
||||
hosts:
|
||||
pve-node-01:
|
||||
ansible_host: 192.168.1.1
|
||||
priv_ip: 192.168.2.1
|
||||
pve_enterprise_key: "pve1c-111111111111"
|
||||
pve-node-02:
|
||||
ansible_host: 192.168.1.2
|
||||
priv_ip: 192.168.2.1
|
||||
pve_enterprise_key: "pve1c-222222222222"
|
||||
pve-node-03:
|
||||
ansible_host: 192.168.1.3
|
||||
priv_ip: 192.168.2.3
|
||||
pve_enterprise_key: "pve1c-333333333333"
|
||||
Reference in New Issue
Block a user