Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

zarf_package_info

List all Zarf packages deployed to a cluster.

Write it as colonel_byte.zarf.zarf_package_info. It runs zarf on the node the task is delegated to; nothing is installed on the cluster’s nodes.

Added in colonel_byte.zarf 0.31.0.

Retrieves the list of packages deployed to the cluster via zarf package list --output-format json and returns structured package records.

Runs on the node the task is delegated to (typically localhost), reaching the cluster through a kubeconfig.

Parameters

ParameterTypeRequiredFlagDescription
kubeconfigpathnoNonePath to the kubeconfig file used to reach the cluster.
zarf_binarypathnoNonePath to the zarf CLI binary on the delegated host. When omitted, zarf on PATH is used.

Notes

  • Set run_once: true and delegate_to: localhost on the task.
  • The module runs in check mode and reports changed: false, because reading a cluster changes nothing.

Example

- name: List deployed zarf packages
  colonel_byte.zarf.zarf_package_info:
    kubeconfig: /etc/rancher/rke2/rke2.yaml
  delegate_to: localhost
  run_once: true
  register: zarf_packages_result

- name: Display package names and versions
  ansible.builtin.debug:
    msg: "{{ zarf_packages_result.packages | map(attribute='package') | list }}"