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
| Parameter | Type | Required | Flag | Description |
|---|---|---|---|---|
kubeconfig | path | no | None | Path to the kubeconfig file used to reach the cluster. |
zarf_binary | path | no | None | Path to the zarf CLI binary on the delegated host. When omitted, zarf on PATH is used. |
Notes
- Set
run_once: trueanddelegate_to: localhoston 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 }}"