I have a hiera (YAML based) data source:
--------------------------------------------------------------
# /etc/puppet/hieradata/foo.yaml
webapp::options:
http_port: 8080
timeout: 500
####################
#
# Set the http_port for "foo"
#
####################
# any of these approaches gave an empty value
foo::http_port: "%{hiera('options['http_port']')}"
foo::http_port: "%{hiera('options::http_port')}"
foo::http_port: "%{hiera('options.http_port')}"
--------------------------------------------------------------
The
"foo" class needs to know the http_port of the webap, and in my case it
should be set to whatever value is in webapp::options['http_port']. The
only work around I found is to do this:
--------------------------------------------------------------
# /etc/puppet/hieradata/foo.yaml
webapp_http_port: 8080
webapp::options:
http_port: "%{hiera('webapp_http_port')}"
timeout: 500
####################
#
# Set the http_port for "foo"
#
####################
foo::http_port: "%{hiera('webapp_http_port')}"
--------------------------------------------------------------
But I was hoping to just extract the value from the hash. Thoughts?