From 6c9db1b2351cc16d599ab946849c4f75237765fc Mon Sep 17 00:00:00 2001 From: Tim 'bastelfreak' Meusel Date: Tue, 25 Jul 2023 13:44:36 +0200 Subject: [PATCH] Switch from create_resources() to .each --- manifests/init.pp | 6 +++++- manifests/volume_group.pp | 23 ++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 7f3140dc..37b0397b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -15,5 +15,9 @@ } } - create_resources('lvm::volume_group', $volume_groups) + $volume_groups.each |String $vg, Hash $vgdata| { + lvm::volume_group { $vg: + * => $vgdata, + } + } } diff --git a/manifests/volume_group.pp b/manifests/volume_group.pp index 9840872d..bb993676 100644 --- a/manifests/volume_group.pp +++ b/manifests/volume_group.pp @@ -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, } @@ -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, } - ) + } }