community.general.proxmox_storage_contents_info (8.5.0) — module

List content from a Proxmox VE storage

| "added in version" 8.2.0 of community.general"

Authors: Julian Vanden Broeck (@l00ptr)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Retrieves information about stored objects on a specific storage attached to a node.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: List existing storages
  community.general.proxmox_storage_contents_info:
    api_host: helldorado
    api_user: root@pam
    api_password: "{{ password | default(omit) }}"
    api_token_id: "{{ token_id | default(omit) }}"
    api_token_secret: "{{ token_secret | default(omit) }}"
    storage: lvm2
    content: backup
    vmid: 130

Inputs

    
node:
    description:
    - Proxmox node to which the storage is attached.
    required: true
    type: str

vmid:
    description:
    - Filter on a specific VMID.
    type: int

content:
    choices:
    - all
    - backup
    - rootdir
    - images
    - iso
    default: all
    description:
    - Filter on a specific content type.
    type: str

storage:
    aliases:
    - name
    description:
    - Only return content stored on that specific storage.
    required: true
    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

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

api_token_id:
    description:
    - Specify the token ID.
    - Requires C(proxmoxer>=1.1.0) to work.
    type: str
    version_added: 1.3.0
    version_added_collection: community.general

validate_certs:
    default: false
    description:
    - If V(false), SSL certificates will not be validated.
    - This should only be used on personally controlled sites using self-signed certificates.
    type: bool

api_token_secret:
    description:
    - Specify the token secret.
    - Requires C(proxmoxer>=1.1.0) to work.
    type: str
    version_added: 1.3.0
    version_added_collection: community.general

Outputs

proxmox_storage_content:
  contains:
    content:
      description: Proxmox content of listed objects on this storage.
      returned: success
      type: str
    ctime:
      description: Creation time of the listed objects.
      returned: success
      type: str
    format:
      description: Format of the listed objects (can be V(raw), V(pbs-vm), V(iso),...).
      returned: success
      type: str
    size:
      description: Size of the listed objects.
      returned: success
      type: int
    subtype:
      description: Subtype of the listed objects (can be V(qemu) or V(lxc)).
      returned: When storage is dedicated to backup, typically on PBS storage.
      type: str
    verification:
      description: Backup verification status of the listed objects.
      returned: When storage is dedicated to backup, typically on PBS storage.
      sample:
        state: ok
        upid: 'UPID:backup-srv:00130F49:1A12D8375:00001CD7:657A2258:verificationjob:daily:v-d0cc18c5-8707:root@pam:'
      type: dict
    volid:
      description: Volume identifier of the listed objects.
      returned: success
      type: str
  description: Content of of storage attached to a node.
  elements: dict
  returned: success
  type: list