Pure Go Ansible playbook engine
Find a file
Snider b7475532a4
Some checks failed
CI / test (push) Has been cancelled
CI / auto-fix (push) Has been cancelled
CI / auto-merge (push) Has been cancelled
chore(repo): canonicalize — add .core/go.yaml + scope .gitignore to runtime subdirs
The .core/ root holds tracked Lethean canon config (go.yaml, build.yaml,
agents.yaml, etc.). Only the runtime subdirs (workspace/, vm/, cache/,
runtime/) and per-repo runtime artifacts should be gitignored.

Brings this repo into the managed canonical set per audit-sweep
discovery filter.

Co-Authored-By: Cladius Maximus <cladius@lethean.io>
2026-05-01 11:23:47 +01:00
.core chore(repo): canonicalize — add .core/go.yaml + scope .gitignore to runtime subdirs 2026-05-01 11:23:47 +01:00
.github/workflows ci: add Core ecosystem CI workflow with CodeRabbit auto-fix 2026-03-17 14:05:54 +00:00
docs refactor(core): align go-ansible with hardened core/go reference shape 2026-04-29 05:30:57 +01:00
external chore(repo): refresh submodules + go.work hygiene (Phase 2 cascade unblock) 2026-05-01 09:38:58 +01:00
go refactor(go): restructure to /go/ subtree (Mantis #1224) 2026-05-01 05:29:46 +01:00
kb refactor(core): align go-ansible with hardened core/go reference shape 2026-04-29 05:30:57 +01:00
.gitignore chore(repo): canonicalize — add .core/go.yaml + scope .gitignore to runtime subdirs 2026-05-01 11:23:47 +01:00
.gitmodules refactor(go): restructure to /go/ subtree (Mantis #1224) 2026-05-01 05:29:46 +01:00
.woodpecker.yml ci: woodpecker pipeline (Go) — golangci-lint/eslint/phpstan + sonar.lthn.sh 2026-04-29 00:02:57 +01:00
AGENTS.md refactor(core): align go-ansible with hardened core/go reference shape 2026-04-29 05:30:57 +01:00
CLAUDE.md refactor(core): align go-ansible with hardened core/go reference shape 2026-04-29 05:30:57 +01:00
CONSUMERS.md refactor(core): align go-ansible with hardened core/go reference shape 2026-04-29 05:30:57 +01:00
CONVENTION_DRIFT_REPORT.md refactor(core): align go-ansible with hardened core/go reference shape 2026-04-29 05:30:57 +01:00
go.work chore(repo): refresh submodules + go.work hygiene (Phase 2 cascade unblock) 2026-05-01 09:38:58 +01:00
LICENCE chore: add EUPL-1.2 LICENCE file (UK English canonical) 2026-05-01 08:33:30 +01:00
README.md refactor(core): align go-ansible with hardened core/go reference shape 2026-04-29 05:30:57 +01:00
sonar-project.properties ci: woodpecker pipeline (Go) — golangci-lint/eslint/phpstan + sonar.lthn.sh 2026-04-28 23:33:13 +01:00

go-ansible

dappco.re/go/ansible is a native Go implementation of core Ansible playbook mechanics. It parses playbooks, inventories, roles, variables, loops, handlers, and common built-in modules, then executes them through either SSH clients or a local controller-side client.

The package is designed for Go programs that need Ansible-style orchestration without shelling out to Python Ansible. It keeps the public surface small:

  • NewParser reads playbooks, inventories, task files, vars files, and role directories.
  • NewExecutor runs parsed playbooks with inventory, host variables, facts, handlers, loops, tags, check mode, and diff reporting.
  • NewSSHClient provides the remote execution client used by the executor.
  • cmd/ansible.Register wires the native runner into a dappco.re/go command tree.

Install

go get dappco.re/go/ansible

Quick Start

executor := ansible.NewExecutor("/srv/playbooks")
if err := executor.SetInventory("/srv/inventory.yml"); err != nil {
    return err
}
executor.SetVar("release", "2026.04")
return executor.Run(context.Background(), "/srv/playbooks/site.yml")

For command integration:

app := core.New()
ansiblecmd.Register(app)

Development

This repository follows the dappco.re/go v0.9 shape: core wrappers are used instead of direct imports for banned standard-library surfaces, public symbols have file-aware Good/Bad/Ugly test triplets, and examples live beside their source file. Run the full gate before handing changes off:

GOWORK=off go mod tidy
GOWORK=off go vet ./...
GOWORK=off go test -count=1 ./...
gofmt -l .
bash /Users/snider/Code/core/go/tests/cli/v090-upgrade/audit.sh .