Skip to content

gringolito/ansible-role-proxmox-ve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ansible-proxmox-ve

Ansible role for configuring a Proxmox VE server/cluster.

Requirements

This role assumes that you are running it on Proxmox server installation.

Cluster joining

For nodes to join on a existing cluster, the current node and existing member should have SSH connection with SSH keys setup.

Role Variables

General configurations

Variable Comment
pve_force_reboot
boolean

Force the server to reboot after executing the role.

Choices:
- true
- false ← (default)

pve_force_reboot
boolean

Force the server to reboot after executing the role.

Choices:
- true
- false ← (default)

pve_enterprise
boolean

Defines whether the server has an PVE-Enterprise license.

Choices:
- true
- false ← (default)

pve_datacenter_tag_style_order
string

Defines the order of the guests tags. Set to config to respect the configuration order. Alphabetical order will be used otherwise.

PCI passthrough (IOMMU) configurations

Variable Comment
pve_iommu_passthrough
boolean

Enable/disable PCI passthrough configuration.

Choices:
- true
- false ← (default)

pve_iommu_intel
boolean

Enable/disable the IOMMU for Intel processors with VT-d/VT-x.

Choices:
- true
- false ← (default)

PVE users/groups configurations

Variable Comment
pve_admin_group
string

Define the Administrators group on the PVE realm.

Default: Administrators

pve_admin_user
string

Define the administrator user on the PVE realm.

Default: admin@pve

pve_audit_group
string

Define the Auditors group on the PVE realm.

Default: Auditors

pve_audit_user
string

Define the audit user on the PVE realm.

Default: audit@pve

PVE cluster configurations

Variable Comment
pve_cluster_create
string

Define the name of PVE cluster to be created.

This variable MUST be defined in only one node per cluster.

pve_cluster_hostname
string

Define the node hostname.

Default: {{ ansible_hostname }}

pve_cluster_join_address
string

Define the address of an existing cluster member to join.

Format: DNS-like name, IP address or IPv6 address.

pve_cluster_link
string

Force the cluster communication to go through the specified link address.

Format: DNS-like name, IP address or IPv6 address.

pve_cluster_ha_shutdown_policy
string

Define the shutdown policy for HA-enabled guests.

Please refer to the Shutdown Policy section on the official Proxmox High Availability guide for more information.

Choices:
- freeze
- failover
- migrate
- conditional

pve_cluster_migration_network
string

Set the network for running guests migration.

Format: IP address/mask or IPv6 address/mask.

PVE local network configurations

Variable Comment
pve_network_interfaces
list / elements=string or interface_config

Defines the local network interfaces configuration.

pve_network_bridges
list / elements=bridge_config

Defines the local network bridges configuration.

pve_network_interface_alias
list / elements=interface_alias

Defines persistent interface alias for local network interfaces. Use this to rename interface to a more convenient names.

interface_config Attributes

Attribute Comment Required / Optional
name
string

The interface name.

For VLAN tagged interfaces append the VLAN tag on the interface name (e.g: eno1.10).

Informing only the name attribute is the same as informing a plain string.

Required
allow
string

Identify the subsystem that should brought up the interface.

Choices:
- hotplug

Optional
address
string

The address to be assigned to the interface.

Format: IP address/mask.

Optional
gateway
string

The network gateway address.

Format: IP address.

Optional
description
string

Free-form comment to be appended on the interface configuration.

Optional

bridge_config Attributes

Attribute Comment Required / Optional
name
string

The bridge name.

Required
interfaces
string
list / elements=string

The physical interface(s) that should be bridged into.

Required
address
string

The address to be assigned to the brigde.

Format: IP address/mask.

Optional
gateway
string

The network gateway address.

Format: IP address.

Optional
vlans
string

Turn the bridge into a VLAN-aware bridge for the configured VLANs.

Format: comma separated list of VLAN ID, range of VLAN IDs can be grouped with dashes (e.g. 2-1000,2000).

Optional
description
string

Free-form comment to be appended on the interface configuration.

Optional

interface_alias Attributes

Attribute Comment Required / Optional
mac_address
string

The MAC address to match the interface.

At least one in mac_address or driver MUST be defined.

Optional
driver
string

The driver to match the interface.

To discover your interface driver you can run:
# ethtool -i {interface_name}

At least one in mac_address or driver MUST be defined.

Optional
interface_name
string

The name (alias) to be configured for the interface.

Required

PVE storage configurations

Variable Comment
pve_cifs_shares
list / elements=cifs_share

Define the CIFS/SMB shares to be added on the server/cluster storage.

pve_nfs_mounts
list / elements=nfs_mount

Define the NFS mounts to be added on the server/cluster storage.

pve_iscsi_targets
list / elements=iscsi_target

Define the iSCSI targets to be added on the server/cluster storage.

pve_iscsi_authentication
iscsi_authentication

Define the iSCSI authentication for the iSCSI targets, whenever authentication is needed.

pve_zfs_pools
list / elements=zfs_pool

Defined the ZFS pools to be added on the server/cluster storage.

pve_lvm_mounts
list / elements=lvm_mount

Define the LVM mounts to be added on the server/cluster storage.

cifs_share Attributes

Attribute Comment Required / Optional
name
string

The storage name on the Proxmox server/cluster.

Required
server
string

The CIFS/SMB server address.

Format: DNS-like name, IP address or IPv6 address.

Required
share
string

The CIFS/SMB share name.

Required
username
string

The CIFS/SMB username credentials.

Required
password
string

The CIFS/SMB password credentials.

Required
content
string

Comma separated list of the storage content types.

Please refer to the Common Storage Properties section on the official Proxmox Storage documentation for more information.

Choices:
- images ← (default)
- rootdir
- vztmpl
- backup
- iso
- snippets

Optional
shared
boolean

Indicate that this is a single storage with the same contents on all nodes.

Choices:
- true ← (default)
- false

Optional

nfs_mount Attributes

Attribute Comment Required / Optional
name
string

The storage name on the Proxmox server/cluster.

Required
server
string

The NFS server address.

Format: DNS-like name, IP address or IPv6 address.

Required
export
path

The NFS export path.

Required
content
string

Comma separated list of the storage content types.

Please refer to the Common Storage Properties section on the official Proxmox Storage documentation for more information.

Choices:
- images ← (default)
- rootdir
- vztmpl
- backup
- iso
- snippets

Optional
nodes
string

Comma separated list of nodes where the should be available, set all for all nodes on the cluster.

Default: all

Optional

iscsi_target Attributes

Attribute Comment Required / Optional
name
string

The storage name on the Proxmox server/cluster.

Required
portal
string

The iSCSI server address.

Format: DNS-like name, IP address or IPv6 address.

Required
target
path

The iSCSI target IQN.

Format: base-name:target

Required
content
string

The iSCSI storage content types.

If you want to use LVM on top of iSCSI, it make sense to set content none. That way it is not possible to create VMs using iSCSI LUNs directly.

Please refer to the Common Storage Properties section on the official Proxmox Storage documentation for more information.

Choices:
- images
- none ← (default)

Optional
nodes
string

Comma separated list of nodes where the should be available, set all for all nodes on the cluster.

Default: all

Optional

iscsi_authentication Attributes

Attribute Comment Required / Optional
username
string

The iSCSI User credentials.

Required
password
string

The iSCSI User secret credentials.

Required
username_in
string

The iSCSI Peer (initiator) User credentials.

Required
password_in
string

The iSCSI Peer (initiator) secret credentials.

Required

zfs_pool Attributes

Attribute Comment Required / Optional
name
string

The storage name on the Proxmox server/cluster.

Required
pool
string

The ZFS pool name.

Required
content
string

Comma separated list of the storage content types.

Please refer to the Common Storage Properties section on the official Proxmox Storage documentation for more information.

Choices:
- images ← (default)
- rootdir

Optional

lvm_mount Attributes

Attribute Comment Required / Optional
name
string

The storage name on the Proxmox server/cluster.

Required
vgname
string

LVM volume group name. This must point to an existing volume group.

Required
content
string

Comma separated list of the storage content types.

Please refer to the Common Storage Properties section on the official Proxmox Storage documentation for more information.

Choices:
- images ← (default)
- rootdir

Optional

Example Playbook

  - name: Configuring Proxmox VE server
    hosts: all
    roles:
      - gringolito.proxmox_ve
    vars:
      pve_datacenter_tag_style_order: config
      pve_iommu_intel: true
      pve_iommu_passthrough: true
      pve_network_interface_alias:
        - driver: r8152
          interface_name: enusb0
      pve_nfs_mounts:
        - name: my-nfs
          server: nfs.gringolito.com
          export: /mnt/nfs/pve
          content: images,backup,iso

License

Beerware

Author Information

Filipe Utzig < filipe at gringolito.com >

About

Ansible playbook for provisioning a Proxmox VE server

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages