Skip to content

feat(k8s): add the ansible toolchain preset and runner rows #7342

Not planned

Description

@devops-cli-service

Split from #4648.

homelab uses Ansible and Kubernetes manifests. An implement run cannot run ansible-lint, because ansible and ansible-lint are in neither RUNNER_TOOLS nor NOT_IN_RUNNER, and ansible-core is in NOT_IN_RUNNER. The ansible preset cannot join PRESETS until the devtools image holds these programs: the image smoke test checks every RUNNER_TOOLS row. This part waits on dan-petty/devtools#97, which adds ansible and ansible-lint to the devtools image. Acceptance criteria: the toolchain registry holds an ansible preset whose static_check names ansible-lint and kube-linter and whose test_command is None; RUNNER_TOOLS holds ansible and ansible-lint with a non-empty check command; ansible-core leaves NOT_IN_RUNNER, and no program is in both tables; a test reads the first word of each command in each preset and fails when a word is in NOT_IN_RUNNER or in neither table; the image smoke test runs python -m devops_cli.roadmap.runner_tools and proves ansible and ansible-lint; the runner image scan passes with no lowered threshold.

Proposed design

Problem statement

homelab uses Ansible and Kubernetes manifests. An implement run cannot lint them. ansible and ansible-lint are in neither RUNNER_TOOLS nor NOT_IN_RUNNER, and ansible-core is in NOT_IN_RUNNER. The toolchain registry has no ansible preset. This change adds the preset, the two runner rows, and a test that keeps each preset command in the runner tables. The change waits on dan-petty/devtools#97.

Acceptance criteria

Requirement: Ansible preset in the toolchain registry

The toolchain registry SHALL hold an ansible preset whose static_check names ansible-lint and kube-linter, and whose test_command is None.

Scenario: The ansible preset

  • WHEN A test reads PRESETS["ansible"] from src/devops_cli/roadmap/toolchains.py.
  • THEN The preset's static_check contains ansible-lint and kube-linter, and its test_command is None.

Requirement: Ansible runner tool rows

RUNNER_TOOLS SHALL hold a row for ansible and a row for ansible-lint, and each row SHALL have a non-empty check command.

Scenario: The two rows have check commands

  • WHEN A test reads the rows ansible and ansible-lint of RUNNER_TOOLS in src/devops_cli/roadmap/runner_tools.py.
  • THEN Both rows exist and each check command is not empty.

Requirement: No program in both tables

ansible-core MUST leave NOT_IN_RUNNER, and no program MUST be in both RUNNER_TOOLS and NOT_IN_RUNNER.

Scenario: The table keys are disjoint

  • WHEN A test compares the keys of RUNNER_TOOLS and NOT_IN_RUNNER.
  • THEN ansible-core is not in NOT_IN_RUNNER, and the two key sets share no program.

Requirement: Preset commands stay in the runner tables

A test SHALL read the first word of each command that a preset names, and SHALL fail when that word is in NOT_IN_RUNNER or in neither table.

Scenario: A preset command word outside the tables

  • WHEN A preset names a command whose first word is in NOT_IN_RUNNER, or whose first word is in neither RUNNER_TOOLS nor NOT_IN_RUNNER.
  • THEN The test fails and its message names the preset and the first word.

Requirement: Runner image proves the two rows

The runner image smoke test MUST prove that ansible and ansible-lint run in the image.

Scenario: Smoke test on the runner image

  • WHEN The ci.yml smoke test runs python -m devops_cli.roadmap.runner_tools on the built runner image.
  • THEN The command exits 0, and the check command of each of the two rows succeeds.

Requirement: Runner image scan keeps its threshold

The change MUST lower no threshold of the runner image scan.

Scenario: Runner image scan

  • WHEN The Runner Image job runs the image scan action on the built runner image.
  • THEN The scan completes with its configured exit code, and the change sets no lower threshold in the workflow or in the action.

Existing Tool Considered

No alternatives check has run on this issue. The open, maintained tools ansible-lint (Ansible project) and kube-linter (StackRox) cover the need: ansible-lint checks Ansible playbooks and roles, and kube-linter checks Kubernetes manifests. They lack a place in the preset registry and the runner tool table, and the runner image does not hold ansible-lint yet. The change adds no linter of its own. The glue is one preset entry, two table rows, one removed row and one test, about 40 lines; no build-and-match cost applies.

Key questions

  • Which checks does the ansible preset name, and what is its test_command?: The preset names ansible-lint and kube-linter in static_check, and its test_command is None. ansible-lint covers the playbooks and kube-linter covers the Kubernetes manifests. (best practice) [sources: src/devops_cli/roadmap/toolchains.py:75, src/devops_cli/roadmap/runner_tools.py:119]
    • Chosen: ansible-lint and kube-linter. The issue body names these two tools, and each checks one half of the repository.
    • Rejected: ansible-lint only. It leaves the Kubernetes manifests of the environment tree unchecked.
    • Rejected: A test_command that runs a playbook. The body sets test_command to None, because an infra repo has no single test playbook.
  • Which table holds ansible-core after the change?: ansible-core leaves NOT_IN_RUNNER. No separate row is needed, because the ansible row names the program that the package provides. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py:119, src/devops_cli/roadmap/runner_tools.py:234]
    • Chosen: Leave NOT_IN_RUNNER and add no row. The ansible row proves the program, and a second row for the same program gives no new check.
    • Rejected: Move it to RUNNER_TOOLS. Its version command repeats the ansible row, so the table would hold two rows for one program.
    • Rejected: Keep it in NOT_IN_RUNNER. The runner now counts on the program that the package provides, so the exclusion is false.
  • Where does the new consistency test live?: The test lives in tests/roadmap/test_roadmap_runner_tools.py, which already tests RUNNER_TOOLS and NOT_IN_RUNNER. (best practice) [sources: tests/roadmap/test_roadmap_runner_tools.py, src/devops_cli/roadmap/toolchains.py:75]
    • Chosen: Add it to tests/roadmap/test_roadmap_runner_tools.py. The module already reads both tables, and the new test reads the same two tables.
    • Rejected: Add a new tests/roadmap/test_roadmap_toolchains.py. A second module for one test adds a file and splits the table checks.
  • Why does the change wait on dan-petty/devtools#97?: The runner image builds FROM the devtools image. The smoke test runs python -m devops_cli.roadmap.runner_tools on the built image, so a row for a program that the image lacks fails the job. The image holds ansible and ansible-lint only after dan-petty/devtools#97. [sources: docs/CLUSTER.md:78, src/devops_cli/roadmap/runner_tools.py:119]
  • Does the runner image scan need a lower threshold for the new binaries?: No. The scan action runs with exit-code: "0" and sends its findings to code scanning, so it stops no build. The change sets no lower threshold. [sources: docs/CLUSTER.md:78]

Fit

Fits in one pull request.

Suspected block

dan-petty/devtools#97 adds ansible and ansible-lint to the devtools image.

Dependencies

None.

Activity

  1. added
    type/feature
    scope/k8s
    source/agent
    status/new
    value/medium
    effort/medium
    on Nov 26, 2026
  2. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    ContributorAuthor
  3. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  4. dan-petty commented on Dec 1, 2026

    @dan-petty
    Owner

    Superseded by the owner decisions of 2026-12-01: the Service jobs give the agent a project-neutral prompt, and the pre-commit hooks of the repository and its pull request CI are the only checks. The toolchain presets and the devops ci command are deleted. See #8040 (implement and fix jobs) and #8039 (stage job). This item extends the toolchain presets.

  5. removed
    status/new
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/k8ssource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions