Skip to content

(PA-9340) Accept facter-cased "AlmaLinux" in install_shell.sh - #854

Closed
imaqsood wants to merge 1 commit into
mainfrom
PA-9340/main/almalinux-platform-casing
Closed

imaqsood wants to merge 1 commit into
mainfrom
PA-9340/main/almalinux-platform-casing

Conversation

@imaqsood

Copy link
Copy Markdown
Contributor

Summary

puppet_agent::install currently fails on every AlmaLinux target with:

INFO: Downloading Puppet latest for AlmaLinux...
CRIT: Sorry AlmaLinux is not supported yet!

AlmaLinux is supported — this is a platform-string casing mismatch. Note the capital L in the error: that is the value the task received.

Root cause

tasks/install_shell.sh maps AlmaLinux onto the el platform by comparing the platform string returned by the puppetlabs-facts bash.sh task against the literal Almalinux:

  # Handle AlmaLinux
  elif test "x$platform" = "xAlmalinux"; then
    platform="el"

puppetlabs-facts PR #71 (commit 2455367, merged to main 2026-09-10, released as facts v1.8.0 on 2026-09-11) added an explicit mapping to munge_name() so bash.sh agrees with facter's os.name:

almalinux) echo "AlmaLinux" ;;

Before that, munge_name()'s generic fallback only uppercased the first character and produced Almalinux, which is what this task was written against.

test/[ string comparison is case sensitive, and install_shell.sh does not set shopt -s nocasematch, so with facts >= 1.8.0 no branch matches, $platform is never mapped to el, and execution falls through to:

  *) critical "Sorry $platform is not supported yet!"

facts is the correct side here (facter reports os.name => AlmaLinux), so the fix belongs in this module. This change accepts both spellings so the task keeps working against older facts releases too.

tasks/install_shell.sh is the only place affected — the manifests, metadata.json and spec/classes/puppet_agent_osfamily_redhat_spec.rb already use AlmaLinux.

Impact

Fleet-wide across the module repos, since each module's .fixtures.yml clones both facts and puppet_agent from GitHub main: all AlmaLinux acceptance jobs went red the day the facts commit landed. Confirmed identical failures in:

It also affects any Bolt/PE user running puppet_agent::install against an AlmaLinux node where facts >= 1.8.0 supplies the platform and facter is not present on the target.

Verification

Ran the task in almalinux:8 and almalinux:9 containers with facts main's bash.sh placed under $PT__installdir/facts/tasks/ and PT__noop=true:

case before after
almalinux:8 CRIT: Sorry AlmaLinux is not supported yet!, exit 1 exit 0, platform=el, download_url=http://yum.puppet.com/puppet8-release-el-8.noarch.rpm
almalinux:9 same CRIT exit 0
stub bash.sh returning the old Almalinux spelling exit 0 exit 0 (back-compat preserved)

bash -n tasks/install_shell.sh is clean. The beaker task-acceptance suite was not run locally (needs VPN/internal Artifactory; its matrix is ubuntu-20.04/rocky-8, so it does not cover this path).

Jira: PA-9340

The install task maps AlmaLinux onto the el platform by comparing the
platform string returned by the puppetlabs-facts bash.sh task against the
literal "Almalinux". puppetlabs-facts 1.8.0 added an explicit
almalinux -> AlmaLinux mapping to munge_name() so bash.sh agrees with
facter's os.name; before that, munge_name()'s generic fallback only
uppercased the first character and produced "Almalinux".

test/[ string comparison is case sensitive and install_shell.sh does not
set nocasematch, so with facts >= 1.8.0 no branch matches, the platform is
never mapped to el, and execution falls through to

  *) critical "Sorry $platform is not supported yet!"

Accept both spellings so the task works against old and new facts.

Verified in almalinux:8 and almalinux:9 containers with facts main's
bash.sh under $PT__installdir and PT__noop=true: before the change both
fail with "Sorry AlmaLinux is not supported yet!"; after it, platform
resolves to el and download_url to
http://yum.puppet.com/puppet8-release-el-8.noarch.rpm. A stub bash.sh
returning the old "Almalinux" spelling still succeeds.

Co-Authored-By: Claude <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused compatibility fix correctly handles both platform spellings without changing unrelated behavior.

Pull request overview

Updates AlmaLinux platform normalization to support current and legacy puppetlabs-facts casing.

Changes:

  • Accepts both AlmaLinux and Almalinux.
  • Preserves compatibility with facts versions before 1.8.0.
File summaries
File Description
tasks/install_shell.sh Maps both AlmaLinux spellings to the el platform.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@joshcooper joshcooper left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The change in behavior in the facts module should be reverted. The change to upper case L should be done in a new major version of the facts module

@imaqsood imaqsood closed this Sep 23, 2026
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.

5 participants