I don't understand how I'd convert the definitions from my original
mail into virtual resources.

Simplified:
$disks = ['/a', '/b']

define foo() {
  file { "${name}/foo": }
}
foo { $disks: }

define bar($path) {
  file { "${name}/foo/${path}":
    require => Foo[$name],
  }
}
bar { $disks:
  path => "bar",
}

And I require those things in multiple classes.
I think this works but apart from being ugly it does not work when
requiring foo from multiple classes. I also cannot require bar
multiple times with different paths because the name is the same (the
array) and I don't know how to get around that. Which kinda defeats
the variability of the define.

I also don't understand how to convert foo to a virtual resource
definition. I need to change it to this:
@foo { $disks: }

and then in bar just add this: Foo <| |> ?

Any help would be really appreciated. I must have read the
documentation four bajillion times now but parts of it it still make
no sense to me. I especially have trouble understanding Virtual
resources, calling a define/resource with an array and requiring
virtual resources and defines.

Cheers,
Lars

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to