Interpolating hiera variables in hiera itself

104 views
Skip to first unread message

Guy Knights

unread,
Dec 13, 2013, 2:39:27 PM12/13/13
to puppet...@googlegroups.com
Is it possible to reuse hiera variables within hiera itself? We have some cases where we have a value that needs to be changed before we deploy some code - it's not ideal, but for now it has to be done this way. The value is used within a hash structure that is somewhat complex, and this value is the only component of that hash that needs to change.

What I was hoping is that I could do something like this:

---
value: '1.1.0'

haproxy_frontends:
  http-in:
    ipaddress: '*'
    ports: '9000'
    options:
      acl:
        - "review_path url_sub version=%{game_version}"
      use_backend:
        - 'review if review_path'
      default_backend: 'current'
  
However, it doesn't seem like this is possible. If I try to do this, when 'haproxy_frontends' is used, nothing is output for %{game_version}.

Is there a way to actually do this?

Thanks,
Guy

Guy Knights

unread,
Dec 13, 2013, 2:57:42 PM12/13/13
to puppet...@googlegroups.com
Well, wouldn't you know it but I just discovered the hiera() lookup function which does exactly what I want.

Thomas Eichberger

unread,
Dec 16, 2013, 10:36:28 AM12/16/13
to puppet...@googlegroups.com
Would be great if you could post an example here :-) I cannot see yet how to use hiera() here.
Reply all
Reply to author
Forward
0 new messages