FAQ
Hey Folks.

Reading through the docs and the mailing list only helped confusing me
more, so maybe its better to just ask if my approach is correct.

Imagine a basic project structure with a module and two classes inside:

modules
- my_module
-frontend
-backend
I'm using Hiera to manage dynamic values, so lets say I have:

---
backend:
foo:
bar: "boo"
baz: 42

So now, if I have an erb template in the my_module::backend class, the
only way to get directly to the values is via a helper variable like

class my_module::backend {
$config = hiera("backend")
}

and then access it in the template via

<%= scope.lookupvar("my_module::backend::config")["foo"]["bar"] %>

Which works, but kind of doesn't feel right.
(Neither does leaving away the scope.lookupvar()).

What would be the idiomatic approach to this?
Is there a way to access Hiera values directly via the ERB template or
is it always recommended to "pipe" them through my puppet modules?

Thanks,

Sebastian

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedNov 1, '12 at 5:20p
activeNov 1, '12 at 5:20p
posts1
users1
websitepuppetlabs.com

1 user in discussion

Sebastian Schulze: 1 post

People

Translate

site design / logo © 2022 Grokbase