>
>
> ... That's not explained very well but I can't think of a better way to 
> phrase it yet. Does that help so far?
>

Perhaps I can show you what I mean. Run these commands and look at the 
debug output in what files Hiera is trying to open, see how it's 
interpreting each variable you add on the command line as new sub 
directories of your hieradata directory, based on how you use the %{env} 
%{location} and %{calling_module} variables in hiera.yaml.

hiera -c /etc/puppet/hiera.yaml rootpwd calling_module=motd --debug
hiera -c /etc/puppet/hiera.yaml rootpwd calling_module=motd env=live --debug
hiera -c /etc/puppet/hiera.yaml rootpwd calling_module=motd env=live 
location=woofwoof --debug

Once you understand that, you've got to get those variables into your 
Puppet manifest before the hiera() function call. This is a very very very 
bad example, but it shows how you need to have those variables present in 
the manifest for Hiera to use them in a lookup:

class motd {
  $env = 'live'
  #$calling_module --- should be an automatic variable given to you by 
Puppet's hiera() function call
  $location = ''
  rootpwd = hiera('rootpwd')
}

-- 
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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to