Skip to content

Commit a29fbae

Browse files
jcpunksimondeziel
authored andcommitted
Permit using arrays to make extending lists easier (voxpupuli#164)
1 parent ead82da commit a29fbae

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

manifests/logind.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
Ini_setting[$option] {
2222
* => $value,
2323
}
24+
} elsif $value =~ Array {
25+
Ini_setting[$option] {
26+
value => join($value, ' '),
27+
}
2428
} else {
2529
Ini_setting[$option] {
2630
value => $value,

spec/classes/init_spec.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@
246246
logind_settings: {
247247
'HandleSuspendKey' => 'ignore',
248248
'KillUserProcesses' => 'no',
249+
'KillExcludeUsers' => ['a', 'b'],
249250
'RemoveIPC' => {
250251
'ensure' => 'absent',
251252
},
@@ -260,7 +261,7 @@
260261
ensure: 'running',
261262
)
262263
}
263-
it { is_expected.to have_ini_setting_resource_count(4) }
264+
it { is_expected.to have_ini_setting_resource_count(5) }
264265
it {
265266
is_expected.to contain_ini_setting('HandleSuspendKey').with(
266267
path: '/etc/systemd/logind.conf',
@@ -277,6 +278,14 @@
277278
value: 'no',
278279
)
279280
}
281+
it {
282+
is_expected.to contain_ini_setting('KillExcludeUsers').with(
283+
path: '/etc/systemd/logind.conf',
284+
section: 'Login',
285+
notify: 'Service[systemd-logind]',
286+
value: 'a b',
287+
)
288+
}
280289
it {
281290
is_expected.to contain_ini_setting('RemoveIPC').with(
282291
path: '/etc/systemd/logind.conf',

0 commit comments

Comments
 (0)