Skip to content

feat(roles/alternatives): support subcommands and family, ensure tooling is installed#259

Open
markuslf wants to merge 1 commit into
mainfrom
feat/alternatives-improvements
Open

feat(roles/alternatives): support subcommands and family, ensure tooling is installed#259
markuslf wants to merge 1 commit into
mainfrom
feat/alternatives-improvements

Conversation

@markuslf
Copy link
Copy Markdown
Member

What

Enhances the alternatives role to use more of the community.general.alternatives module and to be self-sufficient regarding its tooling.

Changes

  • subcommands (slaves/followers, community.general 5.1.0+) and family (Red Hat-family only, 10.1.0+) are now passed through, via default(omit).
  • link / path / priority switched to default(omit) so the module applies its own defaults (e.g. priority 50 on creation) and path is not forced on state: absent.
  • Tooling is ensured installed: chkconfig on RHEL 8, alternatives on RHEL 9/10 (per-version vars/ + shared platform-variables). On Debian/Ubuntu update-alternatives ships with dpkg, so nothing is installed there.
  • alternatives__alternatives is now optional with a default of [] (a no-op include); README moved it to Optional Role Variables and documents the new subkeys.
  • README sharpened (How the Role Behaves, integer priorities, subcommands/family/absent example); meta/argument_specs.yml extended.
  • The Debug task is kept.

Verification

  • yamllint clean; pre-commit hooks pass.
  • Module call with subcommands run end-to-end on Rocky 9 and Debian 12 (master + slave links created, failed=0).
  • Package provenance verified per distro: RHEL 8 chkconfig, RHEL 9/10 alternatives, Debian/Ubuntu dpkg.

Compatibility

No COMPATIBILITY.md change: this adds features, not new platform support. The supported set is unchanged.

…ing is installed

Pass through the module's `subcommands` (slaves/followers) and the Red Hat-only
`family` option, and switch `link`/`path`/`priority` to default(omit) so the
module applies its own defaults.

Ensure the alternatives tooling is installed: `chkconfig` on RHEL 8, `alternatives`
on RHEL 9/10 (via per-version vars + shared platform-variables); on Debian/Ubuntu it
ships with dpkg, so nothing is installed there.

Make `alternatives__alternatives` optional with a default of [] (no-op include),
and document the new subkeys and behavior in the README and argument_specs.
@markuslf markuslf requested a review from NavidSassan May 24, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant