Proxmox Node role#
This role installs and configures a Proxmox node, that is a server which is part of a Proxmox cluster.
It take cares of:
- creating partitions (only use if needed)
- installing ZFS (using aisbergg.zfs)
- installing and configuring Proxmox (using lae.proxmox role)
- configure network interfaces
Creating partitions#
You can declare partitions to ensure they are as expected.
By default this is just a check.
If you need to remove/create them then you will need to add
-e proxmox_node__mkparts=true to you ansible-playbook command line.
You might also bring modifications manually on the host, and check back by running ansible again.
This prevent altering partitions by error !
Creating a cluster#
You will have to:
- create a group in inventory using the cluster name (note: it must not contains "_", but can contain"-")
- add group_vars for the cluster and define:
proxmox_node__pve_cluster_enabled: true- and set
proxmox_node__pve_cluster_nameto the group name
- in host vars for the host:
- set
proxmox_node__pve_cluster_addr0to the private network address of the host - eventually set
proxmox_node__pve_cluster_addr1to the public network address of the host
- set
Then you will have to run the playbook for all the hosts in the group, at the same time. The recipe will chose on of the host as the initial node for the cluster.
Defaults#
---
# the cluster name
proxmox_node__pve_cluster_enabled: false
# It must correspond to a group of nodes in inventory, with corresponding group_vars variables
# Note: proxmox validate cluster name a regex, it can only contains "-" not "_"
# https://github.com/proxmox/pve-common/blob/85d46b41030f538e1e42b570187b0aea3f3f6afd/src/PVE/JSONSchema.pm#L256
# This must be set if proxmox_node__pve_cluster_enabled is true
proxmox_node__pve_cluster_name:
# addr
proxmox_node__pve_cluster_addr0:
proxmox_node__pve_cluster_addr1:
# correspond to pve_storages in lae.proxmox
proxmox_node__pve_storages: []
# correspond to pve_acls in lae.proxmox
proxmox_node__pve_acls: []
# correspond to pve_groups in lae.proxmox
proxmox_node__pve_groups: []
# correspond to pve_users in lae.proxmox
proxmox_node__pve_users: []
# the partitions you want to create or remove
# use this to create partitions for you zpool if needed
proxmox_node__partitions: []
# the zfs pools you want to create or remove
proxmox_node__zfs_pools: []
# supported keys, see https://github.com/aisbergg/ansible-role-zfs
# for example:
# - name: hdd-zfs
# vdev: raidz1 sda5 sdb5 sdc5 sdd5 cache nvme0n1 nvme1n1
# extra_create_options:
# ashift: "12"
# filesystem_properties:
# compress:on
# xattr:sa
# atime:off
# relatime:on
# the filesystems you want to create or remove
# normally you should use this for zfs datasets that are necessary for the system
# not the one managed by proxmox, like containers or virtual machines
proxmox_node__zfs_filesystems: []
# supported keys, see https://github.com/aisbergg/ansible-role-zfs
proxmox_node__zfs_volumes: []
# supported keys, see https://github.com/aisbergg/ansible-role-zfs
proxmox_node__alerts_email: ""
# should we create the partitions or just check if they are there?
# NOTE: the idea is to set that manually to true on the command line,
# when you want to create the partitions
# -e "proxomox_node_mkparts=true"
proxmox_node__mkparts: false
# isos to download with url and checksum
proxmox_node__iso: []
# - url: "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.11.0-amd64-netinst.iso"
# checksum: "sha256:https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/SHA256SUMS"