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

Deploy topology.conf unconditionally #53

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 21 additions & 23 deletions manifests/common/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,29 @@
}

if $slurm::manage_slurm_conf and ! $slurm::configless {
if $slurm::slurmd or $slurm::slurmctld {
concat { 'slurm-topology.conf':
ensure => 'present',
path => $slurm::topology_conf_path,
owner => 'root',
group => 'root',
mode => '0644',
notify => $slurm::service_notify,
}
concat::fragment { 'slurm-topology.conf-header':
target => 'slurm-topology.conf',
content => "# File managed by Puppet - DO NOT EDIT\n",
order => '00',
}
if $slurm::topology_source {
concat::fragment { 'slurm-topology.conf-source':
target => 'slurm-topology.conf',
source => $slurm::topology_source,
order => '01',
}
}
$slurm::switches.each |$name, $switch| {
slurm::switch { $name: * => $switch }
concat { 'slurm-topology.conf':
ensure => 'present',
path => $slurm::topology_conf_path,
owner => 'root',
group => 'root',
mode => '0644',
notify => $slurm::service_notify,
}
concat::fragment { 'slurm-topology.conf-header':
target => 'slurm-topology.conf',
content => "# File managed by Puppet - DO NOT EDIT\n",
order => '00',
}
if $slurm::topology_source {
concat::fragment { 'slurm-topology.conf-source':
target => 'slurm-topology.conf',
source => $slurm::topology_source,
order => '01',
}
}
$slurm::switches.each |$name, $switch| {
optiz0r marked this conversation as resolved.
Show resolved Hide resolved
slurm::switch { $name: * => $switch }
}

if $slurm::slurmd or $slurm::slurmctld {
concat { 'slurm-gres.conf':
Expand Down
36 changes: 13 additions & 23 deletions spec/shared_examples/slurm_common_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,16 @@
'UnkillableStepTimeout=60',
'UsePAM=0',
'VSizeFactor=0',
'WaitTime=0'
'WaitTime=0',

Check failure on line 129 in spec/shared_examples/slurm_common_config.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7)

Style/TrailingCommaInArrayLiteral: Avoid comma after the last item of an array. (https://rubystyle.guide#no-trailing-array-commas)

Check failure on line 129 in spec/shared_examples/slurm_common_config.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2)

Style/TrailingCommaInArrayLiteral: Avoid comma after the last item of an array. (https://rubystyle.guide#no-trailing-array-commas)
treydock marked this conversation as resolved.
Show resolved Hide resolved
])
end

it do
if slurmd || slurmctld
is_expected.to contain_concat('slurm-topology.conf').with(ensure: 'present',
path: '/etc/slurm/topology.conf',
owner: 'root',
group: 'root',
mode: '0644')
else
is_expected.not_to contain_concat('slurm-topology.conf')
end
is_expected.to contain_concat('slurm-topology.conf').with(ensure: 'present',
path: '/etc/slurm/topology.conf',
owner: 'root',
group: 'root',
mode: '0644')
end

it do
Expand Down Expand Up @@ -385,19 +381,15 @@
end

it do
if slurmd || slurmctld
verify_exact_fragment_contents(catalogue, 'slurm-topology.conf-switch01', [
'SwitchName=switch01 Nodes=c01'
])
end
verify_exact_fragment_contents(catalogue, 'slurm-topology.conf-switch01', [
'SwitchName=switch01 Nodes=c01'
])
end

it do
if slurmd || slurmctld
verify_exact_fragment_contents(catalogue, 'slurm-topology.conf-switch00', [
'SwitchName=switch00 Switches=switch01'
])
end
verify_exact_fragment_contents(catalogue, 'slurm-topology.conf-switch00', [
'SwitchName=switch00 Switches=switch01'
])
end
end

Expand Down Expand Up @@ -467,9 +459,7 @@
let(:param_override) { { topology_source: 'file:///path/topology.conf' } }

it do
if slurmd || slurmctld
is_expected.to contain_concat__fragment('slurm-topology.conf-source').with_source('file:///path/topology.conf')
end
is_expected.to contain_concat__fragment('slurm-topology.conf-source').with_source('file:///path/topology.conf')
end
end

Expand Down
Loading