Nested hiera lookup

154 views
Skip to first unread message

Helmut Schneider

unread,
Jan 27, 2022, 10:22:40 AM1/27/22
to puppet...@googlegroups.com
Hi,

common.yaml:
---
lookup_options:
paths:
merge:
strategy: 'deep'
knockout_prefix: '--'
variables:
merge:
strategy: 'deep'
knockout_prefix: '--'
paths:
logfilePath: '/var/log'
[...]

another.yaml:
lookup_options:
paths:
merge:
strategy: 'deep'
knockout_prefix: '--'
variables:
merge:
strategy: 'deep'
knockout_prefix: '--'
variables:
logFile: "%{lookup('paths.logfilePath')}/logfile.log"
[...]

Notice: /var/log
Notice:
/Stage[main]/My_puppet/Logrotate::Include[my_puppet]/Notify[paths
my_puppet:]/message: defined 'message' as '/var/log'
Notice: /logfile.log
Notice:
/Stage[main]/My_puppet/Logrotate::Include[my_puppet]/Notify[variables
my_puppet:]/message: defined 'message' as '/openvpn.log'

Should that work?

helmut@h2873756:~$ puppet -V
7.14.0
helmut@h2873756:~$

Thank you!

Martin Alfke

unread,
Jan 28, 2022, 3:00:29 AM1/28/22
to puppet...@googlegroups.com
Hi Helmut,

This is not working!
Within hiera you can use alias or lookup to receive other hiera data values.
But you can not combine a lookup with string.

Hth,
Martin

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/ssudbh%24kou%241%40ciao.gmane.io.

Reply all
Reply to author
Forward
0 new messages