Guy Knights
2013-Dec-13 19:39 UTC
[Puppet Users] Interpolating hiera variables in hiera itself
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 -- 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 puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/3d877042-9c2f-4b2f-b613-5477e9339593%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Guy Knights
2013-Dec-13 19:57 UTC
[Puppet Users] Re: Interpolating hiera variables in hiera itself
Well, wouldn''t you know it but I just discovered the hiera() lookup function which does exactly what I want. On Friday, 13 December 2013 11:39:27 UTC-8, Guy Knights wrote:> > 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 >-- 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 puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/c9ac272f-62be-483d-824a-46552dac69c3%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Thomas Eichberger
2013-Dec-16 15:36 UTC
[Puppet Users] Re: Interpolating hiera variables in hiera itself
Would be great if you could post an example here :-) I cannot see yet how to use hiera() here. On Friday, December 13, 2013 8:57:42 PM UTC+1, Guy Knights wrote:> > Well, wouldn''t you know it but I just discovered the hiera() lookup > function which does exactly what I want. > > On Friday, 13 December 2013 11:39:27 UTC-8, Guy Knights wrote: >> >> 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 >> >-- 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 puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/9b62440a-5ace-46c1-aade-f73fbd7c3976%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.