From d0e206bdd3ba53f572fb8c64190fe6ccce2d8791 Mon Sep 17 00:00:00 2001 From: "Ben D." Date: Fri, 13 Mar 2026 13:29:15 -0700 Subject: [PATCH] Hypervisor template --- .../client_template/hypervisor_hosts.yml | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 inventories/client_template/hypervisor_hosts.yml diff --git a/inventories/client_template/hypervisor_hosts.yml b/inventories/client_template/hypervisor_hosts.yml new file mode 100644 index 0000000..5b40a7b --- /dev/null +++ b/inventories/client_template/hypervisor_hosts.yml @@ -0,0 +1,114 @@ +--- +# ============================================================================= +# hypervisor_hosts.yml — Physical Hypervisor Node Inventory +# ============================================================================= +# This file defines the physical hypervisor nodes for a client. +# Used by the hypervisor upgrade playbook (proxmox_upgrade.yml, xcpng_upgrade.yml) +# NOT used by guest playbooks (linux_patch, windows_patch, snapshot, etc.) +# +# Supported hypervisor_type values: +# proxmox — Proxmox VE cluster or standalone node +# xcpng — XCP-NG pool +# +# Copy this file to inventories/client_/hypervisor_hosts.yml +# and fill in the values for the client. +# ============================================================================= + +all: + children: + + # ── Proxmox Cluster / Standalone ───────────────────────────────────────── + # Remove this section if client does not use Proxmox + proxmox_cluster: + vars: + hypervisor_type: proxmox + + # Proxmox API connection — used for migration and cluster queries + # Points to any node in the cluster (usually node-01) + api_host: 192.168.X.X + api_port: 8006 + api_token_id: "ansible@pve!ansible-token" + api_token_secret: "REPLACE_ME" + + # Is this a single node or a cluster? + # single — no migration, just upgrade in place + # cluster — rolling upgrade with VM migration + cluster_mode: cluster # cluster | single + + # CEPH — if true, playbook will set noout flag before upgrading each + # node and clear it after the node rejoins the cluster + ceph_enabled: false + + # Shared storage — if false, VMs with local disks cannot be live + # migrated. Playbook will cold-migrate (shutdown) or skip based on + # local_disk_action below. + shared_storage: true + + # What to do with VMs that have local disks when shared_storage: false + # skip — leave them on the node, warn and proceed (risky) + # cold — shut down, migrate, start on new node + # abort — stop the upgrade if any local-disk VMs are found + local_disk_action: cold # skip | cold | abort + + # Rolling upgrade order — list nodes in the order you want them upgraded + # First node in list is drained first. If empty, playbook will sort + # alphabetically. + upgrade_order: + - pm-node-01 + - pm-node-02 + - pm-node-03 + + # SSH user for running apt upgrade on nodes directly + ansible_user: root + ansible_become: false + + # Tags to exclude from migration (e.g. VMs you never want moved) + # migrate_exclude_tags: + # - nomigrate + # - pinned + + hosts: + pm-node-01: + ansible_host: 192.168.X.X + # proxmox_node_name: pm-node-01 # only needed if hostname differs + pm-node-02: + ansible_host: 192.168.X.X + pm-node-03: + ansible_host: 192.168.X.X + + # ── XCP-NG Pool ────────────────────────────────────────────────────────── + # Remove this section if client does not use XCP-NG + xcpng_pool: + vars: + hypervisor_type: xcpng + + # XO (Xen Orchestra) API — used for migration + xo_url: "https://xoa.example.com" + xo_token: "REPLACE_ME" + + # Pool UUID — find with: xe pool-list + pool_uuid: "REPLACE_ME" + + # CEPH not applicable to XCP-NG + ceph_enabled: false + + # Shared storage — XCP-NG SR type + # true if using NFS/iSCSI/Ceph SR, false if local SR only + shared_storage: true + local_disk_action: cold # skip | cold | abort + + upgrade_order: + - xcp-node-01 + - xcp-node-02 + - xcp-node-03 + + ansible_user: root + ansible_become: false + + hosts: + xcp-node-01: + ansible_host: 192.168.X.X + xcp-node-02: + ansible_host: 192.168.X.X + xcp-node-03: + ansible_host: 192.168.X.X \ No newline at end of file