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_pull

Fetch a zarf package to disk.

Write it as colonel_byte.zarf.zarf_package_pull. 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.88.0.

Runs zarf package pull to fetch a package from an oci:// registry or an https:// URL and write it to a directory as a tarball.

The module is a compiled binary with zarf linked into it. It renders the zarf package pull command line from these parameters, executes zarf’s own command in its own process, and reports one JSON result. It needs no zarf on the node.

It is the staging half of an air-gapped workflow: a connected node fetches the package, something carries the file through the airlock, and colonel_byte.zarf.zarf_package_deploy reads it from the path it landed at. Nothing it does reaches a cluster.

Parameters

ParameterTypeRequiredFlagDescription
packagestryesNoneThe package to fetch: an oci:// reference or an https:// URL. The positional argument of the command, so it renders no flag.
output_directorystrno--output-directoryThe directory the tarball is written to. Zarf defaults it to the working directory, which under Ansible is whichever directory the module was invoked from, so a playbook that cares where the package lands says so.
shasumstrno--shasumThe SHA256 checksum of the package. Zarf requires it for a package fetched over https:// rather than merely accepting it.
zarf_configstrnoNoneA zarf config file, passed as ZARF_CONFIG. It is how a playbook keeps registry credentials out of the argument vector.
wrapper_binarystrnoNoneThe module wrapper to run, resolved on the path when it holds no separator. The action plugin consumes this parameter; the wrapper never sees it.
parametersdictnoNoneFurther module parameters, merged into the ones given directly. A parameter given both directly and inside parameters is an error naming it. The action plugin consumes this key; the wrapper never sees it.
oci_concurrencyintno--oci-concurrencyHow many OCI operations zarf runs at once.
architecturestrno--architectureThe architecture of the package to fetch, for a reference that publishes more than one.
cachestrno--cacheZarf’s cache directory.
tmpdirstrno--tmpdirThe directory zarf unpacks into while it works.
plain_httpboolno--plain-httpWhether zarf talks to OCI registries over plain HTTP.
insecure_skip_tls_verifyboolno--insecure-skip-tls-verifyWhether zarf skips verifying TLS certificates it connects to.
log_levelstrno--log-levelZarf’s log level.
log_formatstrno--log-formatZarf’s log format. Defaults to json.

Notes

  • Set run_once: true and delegate_to on the task. The package is fetched once, to the node holding the staging directory.
  • changed is an observation here rather than a convention: the task reports changed only when the pull left a package file the output directory did not already hold, with zarf.changedSignal set to complete and the filenames in zarf.packagesPulled. Zarf derives the filename from the package’s own metadata, so that list is how a playbook learns what to deploy.
  • Check mode reports the task as skipped. zarf package pull has no dry run.
  • A package that is a local path is refused: there is nothing to fetch. Use the path directly with colonel_byte.zarf.zarf_package_deploy.
  • A parameter left unset renders no flag, so whatever zarf’s own config file sets still applies.

Example

- name: Stage a package for the airlock
  colonel_byte.zarf.zarf_package_pull:
    package: oci://ghcr.io/colonel-byte/zarf/csi-local-path-provider:0.0.37-upstream
    output_directory: /srv/staging
  delegate_to: localhost
  run_once: true
  register: pull_result

- name: Deploy what was staged
  colonel_byte.zarf.zarf_package_deploy:
    package: "/srv/staging/{{ pull_result.zarf.packagesPulled | first }}"
    kubeconfig: /etc/rancher/rke2/rke2.yaml
  delegate_to: localhost
  run_once: true
  when: pull_result.zarf.packagesPulled | length > 0