Hello,
I'm trying to figure out how I can use puppet 3 & hiera in an efficient way.
Let's say that I've two classes:
class foo ( $param ) {
notify {"foo": message => "value is ${foo::param}"}
}
class bar ( $param ) {
notify {"bar": message => "value is ${bar::param}"}
}
My hiera file looks like:
---
foo::param: value
bar::param: value
Everything works fine with node:
node mynode {
include foo
include bar
}
Now, let's imagine that I need bar::param to have same value than
foo::param. One way could be to update both of them. But then I need to
make sure that they're always synced. Not so good.
The other way should be to put foo::param as bar::param value, like:
---
foo::param: value
bar::param: %{foo::param}
This works, if and only if I include class foo in my node recipe.
Of course I still could set bar class as follow:
class bar ($param = hiera('foo::param')) { ... }
But, in that case, it introduced a dependency between both classes.
And when classes comes from different modules, this is not always the
desired behavior.
What I would like to do is making hiera resolves "reference" and
automatically retrieve foo::param value, even if foo class is not included.
Use case could be to define some global value like web application
parameters like hostname which should be defined globally and used when
needed.
Any comment welcomed.
Regards,
Jean Baptiste
--
You received this message because you are subscribed to the Google Groups "Puppet
Users" group.
To post to this group, send email to puppet-users@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.