Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6c9db1b

Browse files
committedJul 25, 2023·
Switch from create_resources() to .each
1 parent 22ba15e commit 6c9db1b

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed
 

‎manifests/init.pp

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,9 @@
1515
}
1616
}
1717

18-
create_resources('lvm::volume_group', $volume_groups)
18+
$volume_groups.each |String $vg, Hash $vgdata| {
19+
lvm::volume_group { $vg:
20+
* => $vgdata,
21+
}
22+
}
1923
}

‎manifests/volume_group.pp

+10-13
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@
2222
Boolean $followsymlinks = false,
2323
) {
2424
if $physical_volumes.is_a(Hash) {
25-
create_resources(
26-
'lvm::physical_volume',
27-
$physical_volumes,
28-
{
29-
ensure => $ensure,
25+
$physical_volumes.each |String $pv, Hash $pvdata| {
26+
lvm::physical_volume { $pv:
27+
ensure => $ensure,
28+
* => $pvdata,
3029
}
31-
)
32-
}
33-
else {
30+
}
31+
} else {
3432
physical_volume { $physical_volumes:
3533
ensure => $ensure,
3634
}
@@ -43,12 +41,11 @@
4341
followsymlinks => $followsymlinks,
4442
}
4543

46-
create_resources(
47-
'lvm::logical_volume',
48-
$logical_volumes,
49-
{
44+
$logical_volumes.each |String $lv, Hash $lvdata| {
45+
lvm::logical_volume { $lv:
5046
ensure => $ensure,
5147
volume_group => $name,
48+
* => $lvdata,
5249
}
53-
)
50+
}
5451
}

0 commit comments

Comments
 (0)
Please sign in to comment.