helindbe
05/06/2025, 8:25 PMhelindbe
05/06/2025, 8:28 PMjms1
05/06/2025, 8:29 PMinclude xyz
, it gets the class's parameters from (enc, hiera, etc.) and adds those to an internal "hash of variable values" somewhere, and adds the class's name to a list of classes to be "executed" later on in the compilation process ... then each successive include xyz
notices that the class is already on the list and doesn't do anything else ... yes? (the last time i dealt with compiler design was around 1993)helindbe
05/06/2025, 8:32 PMhelindbe
05/06/2025, 8:33 PMhelindbe
05/06/2025, 8:33 PMjms1
05/06/2025, 8:34 PMinclude
statements, and then later it actually "runs" the code to generate the resource declarations for the cataloghelindbe
05/06/2025, 8:34 PMjms1
05/06/2025, 8:35 PMinclude
, it actually "runs" the code of the "included" class and adds things to the catalog?helindbe
05/06/2025, 8:35 PMjms1
05/06/2025, 8:35 PMhelindbe
05/06/2025, 8:36 PMjms1
05/06/2025, 8:36 PMresources
array in the catalog that gets sent back to the agent?helindbe
05/06/2025, 8:38 PMhelindbe
05/06/2025, 8:38 PMjms1
05/06/2025, 8:39 PMhelindbe
05/06/2025, 8:41 PMhelindbe
05/06/2025, 8:41 PMjms1
05/06/2025, 8:43 PMAdrian Parreiras Horta
05/06/2025, 8:44 PMlookup()
as a class parameter to the class you want to access the other class' parameters from. The linter will warn you about it, but we found it to be occasionally usefulAdrian Parreiras Horta
05/06/2025, 8:46 PMjms1
05/06/2025, 8:46 PMlookup( "class_b::xxx" )
. maybe this has changed since then, but i'm still using PE 2016.2 aka "puppet 4.5.2" (although there is a light at the end of the tunnel, i just hope it isn't an oncoming train)natemccurdy
05/06/2025, 8:48 PMlookup()
is for looking up data from Hiera. It does not lookup variables from classes or class parameters.Adrian Parreiras Horta
05/06/2025, 8:48 PMjms1
05/06/2025, 8:49 PMjms1
05/06/2025, 9:27 PMinclude
will actually "run" the other class the first time, and if i need to access a parameter value or a variable from another class, i just need to be sure to include
that other class before trying to access it.jms1
05/06/2025, 9:28 PMinclude other_class
line before trying to access its variables?natemccurdy
05/06/2025, 9:29 PMinclude
it (or contain
, require
, or declare it like a resource).jms1
05/06/2025, 9:44 PMcsharpsteen
05/06/2025, 10:05 PM