community.general.btrfs_info (8.5.0) — module

Query btrfs filesystem info

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

Authors: Gregory Furlong (@gnfzdz)

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

Query status of available btrfs filesystems, including uuid, label, subvolumes and mountpoints.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

- name: Query information about mounted btrfs filesystems
  community.general.btrfs_info:
  register: my_btrfs_info

Outputs

filesystems:
  contains:
    default_subvolume:
      description: The id of the filesystem's default subvolume.
      sample: 5
      type: int
    devices:
      description: A list of devices assigned to the filesystem.
      sample:
      - /dev/sda1
      - /dev/sdb1
      type: list
    label:
      description: An optional label assigned to the filesystem.
      sample: Tank
      type: str
    subvolumes:
      contains:
        id:
          description: An identifier assigned to the subvolume, unique within the
            containing filesystem.
          sample: 256
          type: int
        mountpoints:
          description: Paths where the subvolume is mounted on the targeted host.
          sample:
          - /home
          type: list
        parent:
          description: The identifier of this subvolume's parent.
          sample: 5
          type: int
        path:
          description: The full path of the subvolume relative to the btrfs fileystem's
            root.
          sample: /@home
          type: str
      description: A list of dicts containing metadata for all of the filesystem's
        subvolumes.
      elements: dict
      type: list
    uuid:
      description: A unique identifier assigned to the filesystem.
      sample: 96c9c605-1454-49b8-a63a-15e2584c208e
      type: str
  description: Summaries of the current state for all btrfs filesystems found on the
    target host.
  elements: dict
  returned: success
  type: list