ci(roles): repeat defaults in argument_specs and fail when they drift from defaults/main.yml #135

Open
opened 2026-11-14 21:50:50 +00:00 by Claude · 3 comments
Owner

Spec: Role standard, resolution comment, "Interface (argument_specs)".

What

  • Every optional input of every role is in defaults/main.yml and in meta/argument_specs.yml, with type, description and a default: equal to the value in defaults. Use choices where the value set is closed. required: true inputs have no entry in defaults.
  • Today system_baseline's profile-derived defaults and systemd_hardening's _disable_services_extra / _disable_services_effective are missing from their specs. Variables that are internal are renamed __<role>_ and moved out of defaults. That rename is covered by the validation and naming issue, so coordinate with it.
  • Add a control that fails Lint when a spec default and defaults/main.yml disagree. Try ansible-docsmith validate first: pin it, run it as a pre-commit hook, and check that it compares values correctly. If it is not reliable, write a short pinned script instead and say why in the PR.

Acceptance

  • ansible-doc -t role shows the real default for every optional input.
  • The control fails on a deliberately mismatched default and passes on main.
Spec: [Role standard](https://git.rkdr.net/Mortis/Kamino/issues/93), resolution comment, "Interface (argument_specs)". ## What - Every optional input of every role is in `defaults/main.yml` and in `meta/argument_specs.yml`, with `type`, `description` and a `default:` equal to the value in defaults. Use `choices` where the value set is closed. `required: true` inputs have no entry in defaults. - Today `system_baseline`'s profile-derived defaults and `systemd_hardening`'s `_disable_services_extra` / `_disable_services_effective` are missing from their specs. Variables that are internal are renamed `__<role>_` and moved out of defaults. That rename is covered by the validation and naming issue, so coordinate with it. - Add a control that fails Lint when a spec default and `defaults/main.yml` disagree. Try `ansible-docsmith validate` first: pin it, run it as a pre-commit hook, and check that it compares values correctly. If it is not reliable, write a short pinned script instead and say why in the PR. ## Acceptance - `ansible-doc -t role` shows the real default for every optional input. - The control fails on a deliberately mismatched default and passes on main.
Claude added the
Status
Ready for Agent
label 2026-11-14 21:50:50 +00:00
Claude added this to the Continuous delivery milestone 2026-11-15 22:21:20 +00:00
Author
Owner

Review of the map (2026-11-15): corrections to this issue.

Review of the map (2026-11-15): corrections to this issue. - The control is added as a pre-commit hook with a pinned tool. `.pre-commit-config.yaml` and `requirements-dev.txt` are inputs of the `ci` image, so this change rebuilds the image. The issue does not say so. - [Order of the implementation backlog](https://git.rkdr.net/Mortis/Kamino/issues/198) decided that [ci(images): assign image versions in CI and open the pin PR right after a push](https://git.rkdr.net/Mortis/Kamino/issues/165) lands before the image-input issues. This issue is now blocked by it. Once it has landed, no version edit is needed here; the merge publishes the next image version and a pin pull request follows.
Author
Owner

Note from What a role's platform declaration means, and supported entry points: the drift check this issue builds will later also compare argument_specs keys, README "Entry points" items and tasks/<key>.yml. That extension is in test(roles): give every supported entry point a spec key, a README entry and a Molecule test, which is blocked by this issue. Nothing changes here, but structure the check so that a second comparison fits.

Note from [What a role's platform declaration means, and supported entry points](https://git.rkdr.net/Mortis/Kamino/issues/207): the drift check this issue builds will later also compare argument_specs keys, README "Entry points" items and `tasks/<key>.yml`. That extension is in [test(roles): give every supported entry point a spec key, a README entry and a Molecule test](https://git.rkdr.net/Mortis/Kamino/issues/227), which is blocked by this issue. Nothing changes here, but structure the check so that a second comparison fits.
Author
Owner

Scope added by Role standard gaps found in review (resolution comment, rule 5): suboption defaults in argument_specs are documentation only, because Ansible does not apply them, so the role applies them itself (default() or combine() in its code). Where the drift check can compare a suboption default with what the role applies cheaply, it does; otherwise the rule is held by review and the check says so in its header.

Scope added by [Role standard gaps found in review](https://git.rkdr.net/Mortis/Kamino/issues/214) (resolution comment, rule 5): suboption defaults in `argument_specs` are documentation only, because Ansible does not apply them, so the role applies them itself (`default()` or `combine()` in its code). Where the drift check can compare a suboption default with what the role applies cheaply, it does; otherwise the rule is held by review and the check says so in its header.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: Mortis/Kamino#135