maxhoesel.proxmox.pbs_directory (5.0.1) — module

Manage the mountpoint for a physical disk on a PBS node

| "added in version" 4.0.0 of maxhoesel.proxmox"

Authors: Max Hösel (@maxhoesel)

Install collection

Install with ansible-galaxy collection install maxhoesel.proxmox:==5.0.1


Add to requirements.yml

  collections:
    - name: maxhoesel.proxmox
      version: 5.0.1

Description

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

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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

Inputs

    
disk:
    description: 'Disk identifier, such as sda or nvme0n1. Ignored if C(state) is absent

      '
    required: true
    type: str

node:
    description: 'Node on which the disk resides. Default: hostname section of I(api_host).

      '
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description: 'The state that the disk should be in. C(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.

      '
    type: str

api_host:
    description:
    - Specify the target host of the Proxmox VE cluster.
    required: true
    type: str

api_user:
    description:
    - Specify the user to authenticate with.
    required: true
    type: str

init_gpt:
    default: true
    description: Whether to first initialize the disk with GPT before adding it as a directory.
    type: bool

filesystem:
    choices:
    - ext4
    - xfs
    description: Type of filesystem to use.
    type: str

mount_name:
    aliases:
    - name
    description: '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 C(state) is absent, then
      this mount will be deleted

      '
    required: true
    type: str

api_password:
    description:
    - Specify the password to authenticate with.
    - You can also use the C(PROXMOX_PASSWORD) environment variable.
    type: str

validate_certs:
    default: false
    description:
    - Validate SSL certificate of the PVE host upon connecting
    type: bool