Ask Your Question
1

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?

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
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

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
0

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_instances:
  'nodemanager':
    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

Stats

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

Seen: 118 times

Last updated: May 17 '14