From 772a9c393e8a51968794b1b8d4292a2389d300fa Mon Sep 17 00:00:00 2001 From: Virgil Date: Thu, 2 Apr 2026 13:46:49 +0000 Subject: [PATCH] chore(ansible): align agent-facing module counts --- CLAUDE.md | 4 ++-- docs/development.md | 2 +- docs/index.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 39db777..222bb62 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -29,10 +29,10 @@ Playbook YAML ──► Parser ──► []Play ──► Executor ──► Mod Inventory YAML ──► Parser ──► Inventory Callbacks (OnPlayStart, OnTaskEnd, ...) ``` -- **`types.go`** — Core structs (`Playbook`, `Play`, `Task`, `TaskResult`, `Inventory`, `Host`, `Facts`) and `KnownModules` registry (80 entries: both FQCN `ansible.builtin.*` and short forms). +- **`types.go`** — Core structs (`Playbook`, `Play`, `Task`, `TaskResult`, `Inventory`, `Host`, `Facts`) and `KnownModules` registry (96 entries: both FQCN `ansible.builtin.*` and short forms, plus compatibility aliases). - **`parser.go`** — YAML parsing for playbooks, inventories, tasks, and roles. Custom `Task.UnmarshalYAML` scans map keys against `KnownModules` to extract the module name and args (since Ansible embeds the module name as a YAML key, not a fixed field). Free-form syntax (`shell: echo hello`) is stored as `Args["_raw_params"]`. Iterator variants (`ParsePlaybookIter`, `ParseTasksIter`, etc.) return `iter.Seq` values. - **`executor.go`** — Orchestration engine: host resolution from inventory, play execution order (gather facts → pre_tasks → roles → tasks → post_tasks → notified handlers), `when:` condition evaluation, `{{ }}` Jinja2-style templating with filter support, loop execution, block/rescue/always, handler notification. -- **`modules.go`** — 41 module handler implementations dispatched via a `switch` on the normalised module name. Each handler extracts args via `getStringArg`/`getBoolArg`, constructs shell commands, runs them via SSH, and returns a `TaskResult`. +- **`modules.go`** — 49 module handler implementations dispatched via a `switch` on the normalised module name. Each handler extracts args via `getStringArg`/`getBoolArg`, constructs shell commands, runs them via SSH, and returns a `TaskResult`. - **`ssh.go`** — SSH client with lazy connection, auth chain (key file → default keys → password), `known_hosts` verification, become/sudo wrapping, file transfer via `cat >` piped through stdin. - **`cmd/ansible/`** — CLI command registration via `core/cli`. Provides `ansible ` and `ansible test ` subcommands with flags for inventory, limit, tags, extra-vars, verbosity, and check mode. diff --git a/docs/development.md b/docs/development.md index 7dd179e..15f5e43 100644 --- a/docs/development.md +++ b/docs/development.md @@ -161,7 +161,7 @@ go-ansible/ types.go Core data types and KnownModules registry parser.go YAML parsing (playbooks, inventories, roles) executor.go Execution engine (orchestration, templating, conditions) - modules.go 41 module handler implementations + modules.go 49 module handler implementations ssh.go SSH client (auth, commands, file transfer, become) *_test.go Test files (see table above) cmd/ diff --git a/docs/index.md b/docs/index.md index a215ad0..8e7a237 100644 --- a/docs/index.md +++ b/docs/index.md @@ -110,7 +110,7 @@ go-ansible/ types.go Core data types: Playbook, Play, Task, Inventory, Host, Facts parser.go YAML parser for playbooks, inventories, tasks, roles executor.go Execution engine: module dispatch, templating, conditions, loops - modules.go 41 module implementations (shell, apt, docker-compose, etc.) + modules.go 49 module implementations (shell, apt, docker-compose, setup, etc.) ssh.go SSH client with key/password auth, become/sudo, file transfer types_test.go Tests for data types and YAML unmarshalling parser_test.go Tests for the YAML parser @@ -126,7 +126,7 @@ go-ansible/ ## Supported Modules -43 module handlers are implemented, covering the most commonly used Ansible modules: +49 module handlers are implemented, covering the most commonly used Ansible modules: | Category | Modules | |----------|---------|