Given the following example hiera config:

my_company::app1:
 - something

my_company::app2:
 - something else

database:
 - [db config ...]

Is there a way to iterate over all entries in namespace my_company? For example create a file for each app. The main constraint is that I need to process only the entries which belong to my_company. I guess the way to do this would be merging all such entries into one big hash, but is there a way to keep them in separate entries and do something like hiera('my_company::*:')?

有帮助吗?

解决方案

As far as I know, not possible.

Rather easy to make it a hash though:

my_company:
  app1:
    - something
  app2:
    - something else

Then $data = hiera('mycompany') gives you all the data.

$app1 = $data['app1']
$app2 = $data['app2']

And so on.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top