maxhoesel.proxmox.pbs_directory module – Manage the mountpoint for a physical disk on a PBS node

Note

This module is part of the maxhoesel.proxmox collection (version 5.1.1).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install maxhoesel.proxmox. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: maxhoesel.proxmox.pbs_directory.

New in maxhoesel.proxmox 4.0.0

Synopsis

  • Initialize a disk, create a FS and mount it on a path on a PBS node, or delete such a path mount. This module can only create mounts on unused disks and will not perform potentially destructive tasks.

Requirements

The below requirements are needed on the host that executes this module.

  • proxmoxer >=1.2

  • requests

Parameters

Parameter

Comments

api_host

string / required

Specify the target host of the Proxmox VE cluster.

api_password

string

Specify the password to authenticate with.

You can also use the PROXMOX_PASSWORD environment variable.

api_user

string / required

Specify the user to authenticate with.

disk

string / required

Disk identifier, such as sda or nvme0n1. Ignored if state is absent

filesystem

string

Type of filesystem to use.

Choices:

  • "ext4"

  • "xfs"

init_gpt

boolean

Whether to first initialize the disk with GPT before adding it as a directory.

Choices:

  • false

  • true ← (default)

mount_name

aliases: name

string / required

Name of the path under which the disk should be mounted. For example, if mount_name=disk1, then the mount will be under /mnt/datastore/disk1. Note that once a disk is mounted that mount path cannot be moved. If state is absent, then this mount will be deleted

node

string

Node on which the disk resides. Default: hostname section of api_host.

state

string

The state that the disk should be in. present will ensure that the disk has a filesystem mounted at the location defined in (mount_name), while absent will remove that directory without touching the disk itself. Note that once a disk is mounted that mount path cannot be moved.

Choices:

  • "present" ← (default)

  • "absent"

validate_certs

boolean

Validate SSL certificate of the PVE host upon connecting

Choices:

  • false ← (default)

  • true

Notes

Note

Examples

- name: Create a mount
  maxhoesel.proxmox.pbs_directory:
    api_user: root@pam
    api_password: secret
    api_host: helldorado
    disk: sda
    mount_name: disk1
    node: hellodorado
    filesystem: ext4

Authors

  • Max Hösel (@maxhoesel)