Skip to main content
filebase64(path) reads the file at path and returns its contents as a base64-encoded string. The path is relative to the playbook’s working directory.

Signature

Example

Read a binary certificate file and embed it in a Kubernetes secret manifest without writing a separate encoding step:

Notes

  • Useful when the target system expects base64-encoded binary content, such as Kubernetes secrets or API payloads.
  • The path is relative to the playbook’s working directory, not the current shell directory.
  • To decode a base64 string back to its original value, use base64decode.