cli

module
v0.40.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2026 License: BSD-3-Clause

README

cli

CLI binaries: ansible-playbook, ansible, ansible-vault, ansible-galaxy, ansible-pull, ansible-doc, ansible-config, ansible-console.

Part of go-ansible — a pure-Go (CGO=0), functional-parity port of Ansible.

CI Go Reference License

Docker / OCI image

Every tagged release publishes a multi-arch image bundling all eight binaries, FROM scratch — no libc, no interpreter, nothing but the static binaries themselves (real Ansible cannot do this: it needs Python plus several pip-installed packages just to be the controller; see BENCHMARKS.md for the measured comparison).

docker run --rm -v "$PWD:/pb" ghcr.io/go-ansible/cli \
  -i /pb/inventory.yml /pb/site.yml

The entrypoint is ansible-playbook; run any other binary with --entrypoint:

docker run --rm --entrypoint ansible-doc ghcr.io/go-ansible/cli setup

Published for linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, and linux/s390x. linux/loong64 is not included — it isn't a platform docker buildx recognizes without additional QEMU/binfmt setup this project's CI doesn't do, unlike the Go test matrix elsewhere in this org, which does cover it directly via qemu-user-static.

Known limitation: command/shell tasks against a local connection need /bin/sh, which doesn't exist in a scratch image — debug/copy/template/set_fact and similar work fine. A playbook targeting a real remote host over SSH is unaffected either way, since the shell requirement is the target's, not this image's.

Directories

Path Synopsis
cmd
ansible command
Command ansible runs a single module against a pattern of inventory hosts (Ansible's "ad-hoc" mode).
Command ansible runs a single module against a pattern of inventory hosts (Ansible's "ad-hoc" mode).
ansible-config command
Command ansible-config shows go-ansible's configuration.
Command ansible-config shows go-ansible's configuration.
ansible-console command
Command ansible-console is an interactive REPL for running ad-hoc modules against a live-changeable host pattern — the interactive counterpart to ansible's one-shot ad-hoc mode.
Command ansible-console is an interactive REPL for running ad-hoc modules against a live-changeable host pattern — the interactive counterpart to ansible's one-shot ad-hoc mode.
ansible-doc command
Command ansible-doc prints documentation for go-ansible's modules.
Command ansible-doc prints documentation for go-ansible's modules.
ansible-galaxy command
Command ansible-galaxy installs roles from a requirements file.
Command ansible-galaxy installs roles from a requirements file.
ansible-playbook command
Command ansible-playbook runs a playbook against an inventory.
Command ansible-playbook runs a playbook against an inventory.
ansible-pull command
Command ansible-pull clones (or updates) a git repository and runs a playbook from it against this machine — the pull-mode counterpart to ansible-playbook's push mode, for a target that fetches and applies its own configuration instead of being reached over SSH.
Command ansible-pull clones (or updates) a git repository and runs a playbook from it against this machine — the pull-mode counterpart to ansible-playbook's push mode, for a target that fetches and applies its own configuration instead of being reached over SSH.
ansible-vault command
Command ansible-vault encrypts/decrypts/views files in Ansible's Vault 1.1 format.
Command ansible-vault encrypts/decrypts/views files in Ansible's Vault 1.1 format.
internal
adhoc
Package adhoc is the ad-hoc single-module-against-a-host-pattern execution logic shared by cmd/ansible and cmd/ansible-console — the same "connect, run one module on every matched host, print a host | STATUS => json line as each finishes" flow both binaries need, factored out once instead of copied.
Package adhoc is the ad-hoc single-module-against-a-host-pattern execution logic shared by cmd/ansible and cmd/ansible-console — the same "connect, run one module on every matched host, print a host | STATUS => json line as each finishes" flow both binaries need, factored out once instead of copied.
extravars
Package extravars parses Ansible's `-e`/`--extra-vars` command-line argument: a `key=value` pair, a raw JSON/YAML object, or `@file` to load one from disk (JSON or YAML, by extension).
Package extravars parses Ansible's `-e`/`--extra-vars` command-line argument: a `key=value` pair, a raw JSON/YAML object, or `@file` to load one from disk (JSON or YAML, by extension).
vaultpw
Package vaultpw resolves the vault password the way real Ansible's CLI does, so every command that accepts --vault-password-file gets the same behavior from one place rather than each growing its own copy.
Package vaultpw resolves the vault password the way real Ansible's CLI does, so every command that accepts --vault-password-file gets the same behavior from one place rather than each growing its own copy.
version
Package version formats a one-line --version string shared by all four go-ansible CLI binaries.
Package version formats a one-line --version string shared by all four go-ansible CLI binaries.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL