Skip to content

Commit

Permalink
Add reconfig_ignore_errors parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock committed Mar 1, 2024
1 parent 6fb619d commit a34a0e1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
# @param reload_services
# @param restart_services
# @param slurmctld_conn_validator_timeout
# @param reconfig_ignore_errors
# @param manage_slurm_user
# @param slurm_user_group
# @param slurm_group_gid
Expand Down Expand Up @@ -240,6 +241,7 @@
Boolean $reload_services = false,
Boolean $restart_services = true,
Integer $slurmctld_conn_validator_timeout = 60,
Boolean $reconfig_ignore_errors = false,

# User and group management
Boolean $manage_slurm_user = true,
Expand Down
7 changes: 7 additions & 0 deletions manifests/slurmctld/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,14 @@
hasrestart => true,
}

if $slurm::reconfig_ignore_errors {
$reconfig_command = 'scontrol reconfig || exit 0'
} else {
$reconfig_command = 'scontrol reconfig'
}

exec { 'scontrol reconfig':
command => $reconfig_command,
path => '/usr/bin:/bin:/usr/sbin:/sbin',
refreshonly => true,
}
Expand Down
16 changes: 16 additions & 0 deletions spec/shared_examples/slurm_slurmctld_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,20 @@
hasstatus: 'true',
hasrestart: 'true')
end

it do
is_expected.to contain_exec('scontrol reconfig').with(
command: 'scontrol reconfig',
path: '/usr/bin:/bin:/usr/sbin:/sbin',
refreshonly: true,
)
end

context 'when ignoring reconfig errors' do
let(:param_override) { { reconfig_ignore_errors: true } }

it do
is_expected.to contain_exec('scontrol reconfig').with_command('scontrol reconfig || exit 0')
end
end
end

0 comments on commit a34a0e1

Please sign in to comment.