Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a parameter to allow a specific group to access compute nodes without having jobs on the node #350

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mboisson
Copy link
Member

No description provided.

@cmd-ntrf cmd-ntrf self-assigned this May 14, 2024
@cmd-ntrf cmd-ntrf added the enhancement New feature or request label May 14, 2024
@@ -560,7 +560,9 @@
}

# Slurm node class. This is where slurmd is ran.
class profile::slurm::node {
class profile::slurm::node (
String $pam_access_group = undef,
Copy link
Member

Choose a reason for hiding this comment

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

If we make this an array instead, we can get rid of the if/else:

Array[String] $pam_acccess_groups = ['wheel']

else {
$access_conf_addon = ''
}
$access_conf = "
Copy link
Member

Choose a reason for hiding this comment

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

$access_conf = @(END)
# Allow root cronjob
+ : root : cron crond :0 tty1 tty2 tty3 tty4 tty5 tty6
# Allow other groups if any
<% for $pam_access_groups.each | $group | { %->
+:<%= $group %>:ALL
<% } -%>
-:ALL:ALL
END

# Allow root cronjob
+ : root : cron crond :0 tty1 tty2 tty3 tty4 tty5 tty6
# Allow admin to connect, deny all other
+:wheel:ALL
${access_conf_addon}
Copy link
Member

Choose a reason for hiding this comment

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

Then access.conf becomes

  file { '/etc/security/access.conf':
    ensure  => present,
    content => inline_template($access_conf, { 'pam_access_groups' => $pam_access_groups }),
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants