Question

My yaml file contains a hashed definition, "nodemanager_instances". The value of the variable, 'nodemanager_port', is not replaced while I am executing puppet. In my common.yaml file, the value is defined. Can anyone find a reason why this is not working?

mwpapp.yaml

nodemanager_instances:
  'nodemanager':
    nodemanager_port: "%{domain_nodemanager_port}"
    domain_name:      "%{::sysfunc}"

common.yaml

domain_nodemanager_port: "5552"

hiera.yaml

:backends:
    - yaml

:yaml:
    :datadir: /etc/puppet/manifests/hiera

:hierarchy:
    - "hostname/%{::hostname}"
    - "sysfunc/%{::sysfunc}"
    - "appotap/%{::app}%{::otap}"
    - "otap/%{::otap}"
    - "domain/%{::domain}"
    - "colo/colo-%{::colo}"
    - "os/%{::operatingsystem}/%{::operatingsystem}-%{::operatingsystemrelease}"
    - "os/%{::operatingsystem}"
    - common/common
Was it helpful?

Solution

For this to work you need Hiera 1.3 or later, and you must use interpolation tokens such as

    nodemanager_port: "%{hiera('domain_nodemanager_port')}"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top