Skip to content

Commit

Permalink
Manage cli_filter.lua like other configless managed configs
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock committed Feb 19, 2024
1 parent abd6ebc commit ae3a575
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 26 deletions.
26 changes: 12 additions & 14 deletions manifests/common/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@
$slurm::nodesets.each |$name, $_nodeset| {
slurm::nodeset { $name: * => $_nodeset }
}
}

if $slurm::manage_slurm_conf and ! $slurm::configless {
concat { 'slurm-topology.conf':
ensure => 'present',
path => $slurm::topology_conf_path,
Expand Down Expand Up @@ -139,20 +137,20 @@
source => $slurm::oci_conf_source,
notify => $slurm::service_notify,
}
}

if ($slurm::client or $slurm::slurmctld) and ($slurm::cli_filter_lua_source or $slurm::cli_filter_lua_content) {
file { "${slurm::conf_dir}/cli_filter.lua":
ensure => 'file',
owner => 'root',
group => 'root',
mode => '0644',
source => $slurm::cli_filter_lua_source,
content => $slurm::cli_filter_lua_content,
}
if $slurm::cli_filter_lua_source or $slurm::cli_filter_lua_content {
file { "${slurm::conf_dir}/cli_filter.lua":
ensure => 'file',
owner => 'root',
group => 'root',
mode => '0644',
source => $slurm::cli_filter_lua_source,
content => $slurm::cli_filter_lua_content,
}

if $slurm::slurmctld and $slurm::enable_configless {
File["${slurm::conf_dir}/cli_filter.lua"] ~> Exec['scontrol reconfig']
if $slurm::slurmctld and $slurm::enable_configless {
File["${slurm::conf_dir}/cli_filter.lua"] ~> Exec['scontrol reconfig']
}
}
}

Expand Down
20 changes: 8 additions & 12 deletions spec/shared_examples/slurm_common_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,18 +210,14 @@
let(:param_override) { { cli_filter_lua_source: 'puppet:///cli_filter.lua' } }

it do
if client || slurmctld
is_expected.to contain_file('/etc/slurm/cli_filter.lua').with(
ensure: 'file',
owner: 'root',
group: 'root',
mode: '0644',
source: 'puppet:///cli_filter.lua',
content: nil,
)
else
is_expected.not_to contain_file('/etc/slurm/cli_filter.lua')
end
is_expected.to contain_file('/etc/slurm/cli_filter.lua').with(
ensure: 'file',
owner: 'root',
group: 'root',
mode: '0644',
source: 'puppet:///cli_filter.lua',
content: nil,
)
end

context 'when configless' do
Expand Down

0 comments on commit ae3a575

Please sign in to comment.