I have a puppet question. (I'm using 5.1.0 version)
In this path: C:\ProgramData\PuppetLabs\code\environments\production\manifests I have the file: site.pp This file (/etc/puppetlabs/puppet/manifests/site.pp) is the main entry point used when an agent connects to a master and asks for an updated configuration.
This is the content of the file now:
node default {
# This is where you can declare classes for all nodes.
# Example:
# class { 'my_class': }
#hiera_include('classes')
include(hiera_array("classes", ))
}
But when I run the puppet with the puppet apply command which is:
"C:\Program Files\Puppet Labs\Puppet\bin\puppet" apply C:\ProgramData\PuppetLabs\code\environments\production\manifests\site.pp
I get this error:
Warning: The function 'hiera_array' is deprecated in favor of using 'lookup'. See https://docs.puppet.com/puppet/5.1/referenc e/deprecated_language.html (file & line not available) Error: Function lookup() did not find a value for the name 'classes'
So I changed the site.pp code into:
node default {
# This is where you can declare classes for all nodes.
# Example:
# class { 'my_class': }
#hiera_include('classes')
include(lookup('classes', {merge => unique}, ))
}
(because I found this doc: https://puppet.com/docs/puppet/5.1/hiera_migrate_functions.html)
And now I get only this error:
Error: Function lookup() did not find a value for the name 'classes'
I'm not sure how to fix it, because this code worked a month ago with the same apply command.
Can you please help me?
Thanks!
lookup('classes', Array[String], 'unique').include
. That will not completely fix your problem though, as it stems from a problem with your Hiera config and data organization which you have not given information about. – Matt Schuchardlookup()
is fine, as indeed the error message he (still) receives supports. The function has multiple alternative signatures, and the OP's use matches one of them. – John Bollinger