Thanks John for showing me a way to do it. I haven't tried that yet but
meanwhile, I was also trying the "define type" but different way. Do you
think this is a better data structure?
rpm_mon_base_pack:
> base-pkg1:
> rep: mon-repo-test
> rpm: rpm-mon-ntp
> ver: latest
> base-pkg2:
> rep: mon-utils-test:
> rpm: rpm-mon-utils
> ver: latest
>
then, in my .pp:
class packages::rpm::monitoring-utils {
>
> $rpm_pkgs_list = hiera_array('rpm_mon_base_pack', undef)
define monitoring_utils_pkgs() {
>
> $i_rpm = $rpm_pkgs_list[$name]
> $u_rpm = inline_template("<%= @i_rpm['rpm'].to_s.chomp %>")
> $u_ver = inline_template("<%= @i_rpm['ver'].to_s.chomp %>")
> $u_rep = inline_template("<%= @i_rpm['rep'].to_s.chomp %>")
>
> package { "$u_rpm":
> ensure => $u_ver,
> require => [
> Yumrepo[ "$u_rep" ],
> Package[ 'mon-tools', 'patch-utils' ],
> ];
> }
> }
> monitoring_utils_pkgs { $rpm_pkgs_list: }
> }
>
But I end up with the error:
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
> Resource title must be a String, not Hash
>
What's doing wrong here? I'll try your suggestion to night as well. Best!
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/43f01cd7-ed8b-4ba3-9fc9-3bc6baf4f8ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.