Skip to content

Commit

Permalink
Switch from create_resources() to .each
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jul 25, 2023
1 parent 22ba15e commit 57a2773
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
6 changes: 5 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@
}
}

create_resources('lvm::volume_group', $volume_groups)
$volume_groups.each |String $vg, Hash $vgdata| {
lvm::volume_group { $vg:
* => $vgdata,
}
}
}
21 changes: 9 additions & 12 deletions manifests/volume_group.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@
Boolean $followsymlinks = false,
) {
if $physical_volumes.is_a(Hash) {
create_resources(
'lvm::physical_volume',
$physical_volumes,
{
ensure => $ensure,
}
)
$physical_volumes.each |String $pv, Hash $pvdata| {
lvm::physical_volume { $pv:
ensure => $ensure,
* => $pvdata,
}
}
else {
physical_volume { $physical_volumes:
Expand All @@ -43,12 +41,11 @@
followsymlinks => $followsymlinks,
}

create_resources(
'lvm::logical_volume',
$logical_volumes,
{
$logical_volumes.each |String $lv, Hash $lvdata| {
lvm::logical_volume { $lv:
ensure => $ensure,
volume_group => $name,
* => $lvdata,
}
)
}
}

0 comments on commit 57a2773

Please sign in to comment.