diff --git a/manifests/common/config.pp b/manifests/common/config.pp index d7c29796..2c2160bc 100644 --- a/manifests/common/config.pp +++ b/manifests/common/config.pp @@ -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| { + slurm::switch { $name: * => $switch } + } if $slurm::slurmd or $slurm::slurmctld { concat { 'slurm-gres.conf': diff --git a/spec/shared_examples/slurm_common_config.rb b/spec/shared_examples/slurm_common_config.rb index 80fade17..9f93f535 100644 --- a/spec/shared_examples/slurm_common_config.rb +++ b/spec/shared_examples/slurm_common_config.rb @@ -126,20 +126,16 @@ 'UnkillableStepTimeout=60', 'UsePAM=0', 'VSizeFactor=0', - 'WaitTime=0' + 'WaitTime=0', ]) 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 @@ -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 @@ -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