Ask Your Question

Hiera: hashed variable definition is not replaced

asked 2014-05-15 06:47:15 -0600

namredlek gravatar image

updated 2014-05-15 10:29:36 -0600

ramindk gravatar image

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?


    nodemanager_port: "%{domain_nodemanager_port}"
    domain_name:      "%{::sysfunc}"


domain_nodemanager_port: "5552"


    - yaml

    :datadir: /etc/puppet/manifests/hiera

    - "hostname/%{::hostname}"
    - "sysfunc/%{::sysfunc}"
    - "appotap/%{::app}%{::otap}"
    - "otap/%{::otap}"
    - "domain/%{::domain}"
    - "colo/colo-%{::colo}"
    - "os/%{::operatingsystem}/%{::operatingsystem}-%{::operatingsystemrelease}"
    - "os/%{::operatingsystem}"
    - common/common
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-05-16 03:49:51 -0600

namredlek gravatar image

It should be working. We are using Hiera 1.2 This solution should work in Hiera 1.3. We are planning an upgrade.

edit flag offensive delete link more

answered 2014-05-17 05:30:54 -0600

daff gravatar image

Shouldn't your hashed definition use Hiera-ception (sublookups) to get the value of domain_nodemanager_port? Like this:

    nodemanager_port: "%{hiera('domain_nodemanager_port')}"
    domain_name:      "%{::sysfunc}"

Note that this requires Hiera 1.3.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-05-15 06:47:15 -0600

Seen: 129 times

Last updated: May 17 '14