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

Fix slurm::spank when managing package and using configless #8

Merged
merged 2 commits into from
Aug 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 5 additions & 2 deletions manifests/spank.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,23 @@
}

if $manage_package {
$fragment_require = Package["SLURM SPANK ${name} package"]
package { "SLURM SPANK ${name} package":
ensure => 'installed',
name => $package_name,
before => Concat::Fragment["plugstack.conf-${name}"],
notify => $slurm::slurmd_notify,
notify => $slurm::service_notify,
require => $package_require,
}
} else {
$fragment_require = undef
}

if $slurm::manage_slurm_conf and ! $slurm::configless {
concat::fragment { "plugstack.conf-${name}":
target => 'plugstack.conf',
content => template('slurm/spank/plugin.conf.erb'),
order => $order,
require => $fragment_require,
}
}

Expand Down
11 changes: 10 additions & 1 deletion spec/defines/slurm_spank_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
it do
is_expected.to contain_package('SLURM SPANK x11 package').only_with(ensure: 'installed',
name: 'slurm-spank-x11',
before: 'Concat::Fragment[plugstack.conf-x11]')
notify: [])
end

it do
is_expected.to contain_concat__fragment('plugstack.conf-x11').only_with(
target: 'plugstack.conf',
content: %r{^optional x11.so$},
order: '50',
require: 'Package[SLURM SPANK x11 package]',
)
end

Expand Down Expand Up @@ -75,6 +76,14 @@
end
end

describe 'configless' do
let(:pre_condition) { "class { 'slurm': slurmd => true, configless => true }" }

it 'works without error' do
is_expected.to create_slurm__spank('x11')
end
end

describe 'auks example' do
let(:title) { 'auks' }
let(:params) do
Expand Down