I'm trying to make a defined type with two parameters and pass an array for
each parameter.
My first try was something like this:
init.pp
define mything ($user, $version) {
exec {$user_$version:
command => something needing both $user and $version
}
}
in the node file:
$user = [ "A", "B", "C", "D"]
$version = [ "1.5", "2.0", "4.2", "0.01" ]
mything { "thing":
user => $user,
version => $version,
}
Now of course this didn't do what I want it to do (give all the users in
$users all of the versions in $version)
Searching I came across a post that said do something using $title like
init.pp
define mything ($version) {
exec {$version:
command => something using $foo and $title
}
}
and the node file
$user = [ "A", "B", "C", "D" ]
mything { $user:
version => "1.5"
}
However this still means I'd have to do one for each version (and figure
out how to avoid a Duplicate definition problem.
Is there an easy or a right way to do what I'm trying to do?
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/9_zxAPURFbIJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.