merge 2 of more files

27 views
Skip to first unread message

Patrick G.

unread,
Sep 7, 2015, 8:08:13 AM9/7/15
to Puppet Users
Hi,

In /etc/puppet/hieradata/users/ I have 2 yaml files.
For a node I want to merge these files and on the other node only one file.

In the /etc/puppet/enc/nodes/server1.yaml I have:
---
classes:
  - ssh
parameters:
  usergroups: 
    - group1
    - group2

And on the other node only -group2.

The problem is that the first node is not merging the 2 files.

What am I doing wrong here?

regards, Patrick.

jcbollinger

unread,
Sep 8, 2015, 10:35:03 AM9/8/15
to Puppet Users

In the first place, Hiera does not merge multiple files from the same hierarchy level.  For any given lookup it will consider at most one file from each defined level.

More generally, however, it's unclear to me how you (think you) are associating Hiera data files with your nodes, or why you expect the results you do from the configuration difference you describe.  Indeed, it is not even clear what is the significance of the yaml file you present, though I think I can guess.

To give you any useful advice, we'll need to see at least your Hiera data hierarchy (ordinarily described in hiera.yaml), the context in which you are trying to consume the hiera data (class declaration and class definition if you are trying to consume the data via automated parameter binding, or a call to one of the hiera data lookup functions otherwise).  To prevent this from dragging out, please also provide the relevant hiera data file(s), and tell us what data you expected / wanted to retrieve, why you expected that, and what data hiera actually provided.


John

Reply all
Reply to author
Forward
0 new messages