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 6c9db1b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 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,
}
}
}
23 changes: 10 additions & 13 deletions manifests/volume_group.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@
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 {
}
} else {
physical_volume { $physical_volumes:
ensure => $ensure,
}
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 6c9db1b

Please sign in to comment.