Hello. Sometimes it is desirable to define Hiera variables for usage in 
Hiera itself, i.e. variables that won't be looked up from Puppet manifests. 
We do this to avoid repetition. Here's an example of a variable used only 
in the file it is defined:

    _internal_api_host: 'int.api.example.com'
    profile::keepalived::vrrp_script:
      ping_internal_api:
        script: "curl https://%{lookup('_internal_api_host')}/ping"
    profile::nginx::servers:
      "%{alias('_internal_api_host')}":
        ...

Sometimes we also define this kind of variables in one file but do lookups 
somewhere else:

hieradata/project/foo.yaml:
    profile::base::network::interfaces:
      eth0:
        method: 'static'
        address: "%{lookup('_INTERNAL_IP')}/24"

hieradata/project/foo/foo1.yaml:
    _INTERNAL_IP: '10.1.2.3'

For us this became an issue. There are no conventions, and therefore no 
consistency in our quite large hiera. Sometimes we can't even tell whether 
some variable is looked up from manifests or is "local" for Hiera. For 
example, the "_INTERNAL_IP" above is named 
"profile::base::network::intern_ip" in some projects.

The question is... Is this a normal practice? How do other folks handle 
these cases? I couldn't find any information regarding this. Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/282b3812-287a-4eb0-a838-591f2c3f925an%40googlegroups.com.

Reply via email to