chore(slurm): derive PAM module directory from target architecture - #1398
Open
100milliongold wants to merge 1 commit into
Open
chore(slurm): derive PAM module directory from target architecture#1398100milliongold wants to merge 1 commit into
100milliongold wants to merge 1 commit into
Conversation
The Debian multiarch tuple was hardcoded to x86_64-linux-gnu, so an aarch64 node ended up with a /lib/x86_64-linux-gnu/security directory. Nothing breaks today: the same variable feeds --with-pam_dir at configure time and the path written into /etc/pam.d/sshd, so the build installs the module exactly where PAM looks for it. The directory name is still wrong for the host. Resolve the tuple from ansible_architecture through an explicit map. The map is explicit rather than an "<arch>-linux-gnu" format string because armv7l maps to arm-linux-gnueabihf and ppc64le to powerpc64le-linux-gnu, neither of which follows that shape. An unlisted architecture falls back to the format string so the role does not hard-fail. x86_64 resolves to the same value as before. roles/slurm/vars/redhat.yml is already architecture-agnostic (/lib64/security); this brings the Ubuntu path in line with it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
A hygiene change, not a bug fix. The current code works on ARM — this
explains why, and why the hardcoded tuple is still worth removing.
roles/slurm/vars/ubuntu.ymlhardcodes the Debian multiarch tuple:On an aarch64 host this makes the play create and use
/lib/x86_64-linux-gnu/security, which is not that host's multiarch path.Why nothing breaks today
slurm_pam_lib_dirhas exactly two direct consumers, and they cancel out:roles/slurm/defaults/main.yml:19-20--with-pam_dir={{ slurm_pam_lib_dir }}inslurm_configureroles/slurm/tasks/build.yml:209-219contribs/pam_slurm_adoptandmake installs it into the--with-pam_dirset aboveroles/slurm/tasks/compute.yml:165,167,180/etc/pam.d/sshdroles/slurm/tasks/build.yml:166,172runsslurm_configure, so DeepOps buildsSlurm from source, and lines 209-219 then build and install
pam_slurm_adoptitself (209-213 and 215-219, both guarded by
when: slurm_build):That
make installhonours the--with-pam_dirfrom configure. So the samevariable decides where the build puts the module and where PAM looks for it.
Both move together,
make installcreates the directory, and the module loads.The PAM lines are also prefixed with
-, so even a missing module would beskipped rather than fail the login.
Why change it anyway
ends up with
/lib/x86_64-linux-gnu/security, outside the standard multiarchlayout, which misleads anyone inspecting the node.
roles/slurm/vars/redhat.yml:2is/lib64/security, correct on everyarchitecture. Only the Ubuntu path carries a hardcoded tuple.
for example an air-gapped flow that ships a prebuilt binary, where the
install path is decided elsewhere.
--with-pam_dirgoes away — switching to the distro package(
slurm-wlm, which installs into the real multiarch path) or to any variantthat does not pass that flag.
Change
Resolve the tuple from
ansible_architecturethrough an explicit map. The map isexplicit rather than an
<arch>-linux-gnuformat string because two realarchitectures do not follow that shape:
/lib/x86_64-linux-gnu/security/lib/aarch64-linux-gnu/security/lib/aarch64-linux-gnu/security/lib/arm-linux-gnueabihf/securityarmv7l-linux-gnu/lib/powerpc64le-linux-gnu/securityppc64le-linux-gnuA format string would have produced
armv7l-linux-gnuandppc64le-linux-gnu,neither of which exists on those hosts. The fallback keeps format-string
behaviour for an unlisted architecture so the role does not hard-fail, and the
comment tells the next person to add an entry.
arm64is included to match existing repository practice:roles/nvidia-dgx/vars/ubuntu-24.04.yml:2already testsansible_architecture in ['aarch64', 'arm64'].x86_64 resolves to the same value as before, so this is a no-op on existing
clusters.
Verification
Directories checked inside real Debian-family containers on each architecture:
Template rendering checked for all five map keys plus one unlisted architecture;
each resolved to the table above.