Hiera merge issue

38 views
Skip to first unread message

Constantin B

unread,
Nov 21, 2017, 11:01:39 AM11/21/17
to Puppet Users
Hello

i run : 

puppet lookup --node xxxx --debug --explain sshkeys::users

 on puppet master it return a correctly merged array
i have group/xxx.ymal + common.yaml 
i have set 


lookup_options:
  sshkeys::users:                     # This lookup option applies to parameter 'local' of class 'users'
    merge:                          # Merge the values found across hierarchies, instead of getting the first one
      strategy: deep                # Do a deep merge, useful when dealing with Hashes (to override single subkeys)
      merge_hash_arrays: true


so it works fine on master and the result is correctly merged xxx + common 

when i run puppet agent -t on xxxx node to apply the config the merge is incorrect it only takes xxx.yaml 
but ignore common.yaml 


how this is possible ? 
how to debug hiera from slave node ? 

thanks it get me crazy


jcbollinger

unread,
Nov 22, 2017, 8:52:44 AM11/22/17
to Puppet Users
If the catalog builder really is obtaining different values for the same key than puppet lookup does, with the two running on the same machine (i.e. the master), then the only possibilities are that the two are using different configurations or looking at different data.  They might well be using different configurations if they are running as different users, and they might be looking at different data if they are referring to different environments (i.e. if the catalog is being built for a node that self-assigns its environment).

 
how to debug hiera from slave node ? 


Generally speaking, you can effectively debug data lookups only on the machine that is actually performing the lookups.  In a master / agent setup, that means the master.  You can, however, use other nodes to probe lookup results by adding a `Notify` resource or a `File` resource to report on the exact result of the lookup itself, as performed by the master during catalog building.  That might help you discern whether the problem is with the lookup itself, or whether it is with how the looked-up data are used.


John

Reply all
Reply to author
Forward
0 new messages