Skip to content

Fix os.family references for Arch and Gentoo-based distributions#333

Merged
saz merged 1 commit intosaz:masterfrom
zbentley:332_fix_arch_linux_alternative_distributions
Apr 22, 2026
Merged

Fix os.family references for Arch and Gentoo-based distributions#333
saz merged 1 commit intosaz:masterfrom
zbentley:332_fix_arch_linux_alternative_distributions

Conversation

@zbentley
Copy link
Copy Markdown
Contributor

Pull Request (PR) description

Switches to matching Gentoo and Arch via os.family instead of os.name.

Previously, code handled Manjaro/Gentoo/Arch-vanilla by checking if the name was "Gentoo", or if it started with "Arch" or "Manjaro" and ended with nothing or "linux". Facter already uses equivalent logic to generate the os.family fact, here, so it doesn't need to be reimplemented in this module: https://github.com/puppetlabs/facter/blob/main/lib/facter/util/facts/facts_utils.rb#L24

Side effects:

  • All Arch distributions, vanilla and non (including Manjaro, Artix, CachyOS, and so on) should now be supported.
  • Gentoo distributions with a custom OS name (more common than you'd think) would now be supported.

This Pull Request (PR) fixes the following issues

Fixes #332

@zbentley zbentley changed the title Fix family references for Arch and Gentoo-based distributions Fix os.family references for Arch and Gentoo-based distributions Feb 16, 2026
@saz saz requested a review from Copilot April 22, 2026 07:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates sudo module platform detection to rely on Facter’s os.family for Arch- and Gentoo-based systems, avoiding brittle os.name matching and fixing failures on Arch derivatives like CachyOS (Issue #332).

Changes:

  • Add explicit case $facts['os']['family'] branches for Archlinux and Gentoo.
  • Remove the prior os.name-based special-casing (Gentoo exact match and Arch/Manjaro regex) and keep unsupported platforms failing fast.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread manifests/params.pp
Comment on lines +222 to +231
'Archlinux': {
$package = 'sudo'
$package_ldap = $package
$package_ensure = 'present'
$package_source = undef
$package_admin_file = undef
$config_file = '/etc/sudoers'
$config_dir = '/etc/sudoers.d'
$content_template = "${content_base}sudoers.archlinux.erb"
$secure_path = undef
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change broadens support by keying off os.family for Archlinux/Gentoo, but there are no unit tests asserting the new behavior (e.g., os.family => 'Archlinux' with os.name => 'CachyOS', and os.family => 'Gentoo' with a non-'Gentoo' os.name). Adding rspec-puppet examples for these fact combinations would prevent regressions and validate the fix for #332.

Copilot uses AI. Check for mistakes.
@saz saz merged commit cf75512 into saz:master Apr 22, 2026
5 checks passed
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.

Arch linux distributions other than Manjaro and default Arch fail with "Unsupported platform"

3 participants