1
votes

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
1

1 Answers

1
votes

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')}"