ansible: entry-list play bodies + ansible-applier - #5
Merged
Conversation
polyedre
force-pushed
the
ansible-entry-grammar
branch
from
September 5, 2026 14:22
72f3a04 to
ad1ca7e
Compare
`(appliers ("ansible" (ansible-applier #:inventory inv)))` writes the
playbook and inventory JSON under deploy/ and runs ansible-playbook on them;
--dry-run maps to --check --diff, diff mode is refused (no drift exit code).
`hexol apply` hands the first flag it does not own and everything after it
to the appliers through the `applier-args` parameter, so
`hexol apply -i examples/ansible.scm --list-tasks --limit web1.acme.example`
reaches ansible-playbook as typed.
Drop the tracked deploy/golden files: deploy/ is generated output and
already ignored.
polyedre
force-pushed
the
ansible-entry-grammar
branch
from
September 5, 2026 15:51
ad1ca7e to
08c55ed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rework the Ansible surface so an inventory reads as a list of declarations, with functions reserved for sugar and control flow.
tasks,as,each,only,handlers):("Name" (module (arg val) …) #:keyword val …)declares a task, in YAML order (name, module dict, task-level keywords).ansible.builtin.<module>; dotted names are taken as written.asis now a body form taking a bare user symbol ((as root …)), still nesting with innermost-wins.each/onlyreplacemap/ifplumbing;taskremains for a single task outside a body.task/handlerrecord macros, theasprocedure and the example's localcat/tasks/copyhelpers.examples/ansible.scmrewritten as one declaration list per host (358 → 227 lines); rendered playbook is byte-identical to before except that task-level keys (when,register) now follow the module dict.test.scm.Applier:
hexol applyruns ansible-playbookansible-applier #:inventory (path | state alist)writesdeploy/playbook.jsonanddeploy/inventory.json(state alist converted to Ansibleall/hosts/childrenshape) and runsansible-playbook -i INV PB ….--dry-runmaps to--check --diff;hexol diffis refused (ansible has no drift exit code).hexol applypasses the first flag it does not own, and everything after it, to the appliers via the newapplier-argsparameter:examples/ansible.scmregisters(appliers ("ansible" (ansible-applier #:inventory inv))).deploy/golden/files:deploy/is generated output and already gitignored.Test plan
make buildguile -L . test.scm— all checks passed (new ansible checks included)make test-examples— all example renders passedguile -L . test/apply-mode.scm— ansible applier checks (PATH shim) passguix shell ansible -- ./bin/hexol apply -i examples/ansible.scm --list-tasks --limit web1.acme.examplelists play CI: provision from manifest.scm via Guix #1 onlyhexol render -o ansible -i examples/ansible.scmdiffed against pre-change output: identical modulo key order noted abovemake testin full fails locally ontest/import.scm(Unbound variable: make-yaml_parser_t, libyaml FFI missing in this environment) — pre-existing, unrelated🤖 Generated with Claude Code