jms1
08/06/2025, 1:54 PM$title of the define, and the caller's filename and line number, would also be "nice to have"jms1
08/06/2025, 2:13 PMdebug_notice() function which runs notice() but only if "debugging is enabled" for the module which called the function ... i'm thinking the list of modules to have debug messages enabled will be configured via custom fact on the target machine ... this is to have debug messages working while i'm hacking on the code, but not pollute the puppetserver's logs with debugging logs that aren't needed ... if there's already some other way to do this, i'd love a pointer to that as wellcsharpsteen
08/06/2025, 2:29 PMdebug_notice(). I'd caution against using this to drive actual function logic as having function behavior depend on items that aren't explicitly passed as arguments leads to difficult debugging.jms1
08/06/2025, 2:31 PMjms1
08/06/2025, 2:32 PMcsharpsteen
08/06/2025, 2:36 PMstrict_variables, which is on by default in Puppet 8. Historically, they were used for guiding Hiera lookups, but that use case has been supplanted by the Module Data layer.jms1
08/06/2025, 2:37 PMtahu in obsidian and found where i wrote this down on 2025-05-05 ... i just added some text to that note (including the word "caller") to make it easier to find the next time i feel like asking the same question againjms1
08/06/2025, 4:32 PM$caller_module_name, but that doesn't seem to work within a function (neither does $module_name for that matter) ... am i missing something maybe?csharpsteen
08/06/2025, 4:34 PMjms1
08/06/2025, 4:35 PMjms1
08/06/2025, 4:35 PMPuppet::Pops::PuppetStack API existed in PE 2016.2.0 (aka Puppet 4.5.2) ?csharpsteen
08/06/2025, 4:35 PMcsharpsteen
08/06/2025, 4:36 PMPuppet::Pops::PuppetStack was definitely added sometime after Puppet 4, but I'm not sure when. Quickest way to find out would be to just draft out a function that calls it and see if you get an undefined method error.jms1
08/06/2025, 4:39 PMjms1
08/06/2025, 4:39 PMcsharpsteen
08/06/2025, 8:56 PMPuppetStack showed up in the 4.6.0 release:
https://github.com/puppetlabs/puppet/commit/2211c646921f85a31611f018cd8bfaab76692c98jms1
08/07/2025, 6:52 PMjms1
08/07/2025, 6:52 PMPuppetstack stuff for file/line info, but i'm also hoping that $module_name and $caller_module_name will work within puppet-language functions, the same way they do within defined types