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

state

Fetch and parse the Zarf state secret from a cluster into an Ansible fact.

Include it as colonel_byte.zarf.state.

Added in colonel_byte.zarf 0.31.0.

Queries the cluster for the zarf-state Secret via zarf tools kubectl and sets the parsed state as the zarf_state fact.

The credentials the Secret holds are withheld unless zarf_include_credentials is set. The paths that were withheld are set as the zarf_state_redacted fact.

Every task carries run_once: true, no_log from zarf_no_log, and delegates to zarf_delegate_to.

Variables

VariableTypeDefaultDescription
zarf_kubeconfigstr""Path to the kubeconfig file used to reach the cluster. Left empty, uses default kubeconfig.
zarf_delegate_tostrlocalhostThe node on which to execute the zarf state query.
zarf_binarystrzarfPath to the zarf binary on the delegated host.
zarf_namespacestrzarfThe namespace holding the zarf-state Secret.
zarf_include_credentialsboolfalseWhether to return the credentials the zarf-state Secret holds: the registry push, pull and seed secrets, the git server passwords, the artifact server token, and the agent’s TLS private key. Left false, they are removed from zarf_state and named in zarf_state_redacted.
zarf_no_logbooltrueWhether to suppress task parameter and result logging. Applied to the set_fact task as well as to the module call, because set_fact prints the fact it sets. Set it to false when debugging locally.