puppetlabs/hiera — pull request #137 by lollipopman (2013-06-20 14:56:25+00:00)
Title: Add support for a hiera variable syntax which interpolates data by

performing a hiera lookup

[Redmine Ticket](https://projects.puppetlabs.com/issues/21367)

This commit adds support for interpolating hiera data in a similar
fashion to how scope interpolation functions in hiera. This commit adds
the syntax `^{foo}` to differentiate hiera lookups from scope lookups,
`%{foo}`.

ips.yaml

potto01_ip: 10.10.1.52

pott01.yaml

firewall_rules:
- "0.0.0.0:22:^{pott01_ip}"

When evaluating the string, `"0.0.0.0:22:^{pott01_ip}"` hiera would
lookup the value for pott01_ip in hiera and interpolate that into the
string, the result being, `"0.0.0.0:22:10.10.1.52"`. This avoids having
to repeatedly perform this type of lookup logic in puppet and allows you
to use your hiera data from within hiera itself.