Skip to content

Commit 57a2773

Browse files
committed
Switch from create_resources() to .each
1 parent 22ba15e commit 57a2773

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
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

+9-12
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@
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,
30-
}
31-
)
25+
$physical_volumes.each |String $pv, Hash $pvdata| {
26+
lvm::physical_volume { $pv:
27+
ensure => $ensure,
28+
* => $pvdata,
29+
}
3230
}
3331
else {
3432
physical_volume { $physical_volumes:
@@ -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)