rusty
02/10/2023, 7:17 PMDr Bunsen Honeydew
02/10/2023, 7:18 PMnatemccurdy
02/10/2023, 7:18 PMapply vs. agent is to check for the presence of the $server_facts['servername'] variable
ref: https://www.puppet.com/docs/puppet/7/lang_facts_builtin_variables.html#lang_facts_builtin_variables-server-factsrusty
02/10/2023, 7:21 PMnatemccurdy
02/10/2023, 7:21 PMget() or getvar() functions when dealing with values that might be undef.
https://www.puppet.com/docs/puppet/7/function.html#get
https://www.puppet.com/docs/puppet/7/function.html#getvar
They allow for setting a default value if the variable's value is undef.Mike Langhorst
02/10/2023, 7:22 PMSlackbot
02/10/2023, 7:24 PMMike Langhorst
02/10/2023, 7:25 PMMike Langhorst
02/10/2023, 7:26 PMnatemccurdy
02/10/2023, 7:26 PMgetvar() to have a default for a class parameter that might come from Hiera:
class foo (
Optional[String] $param1 = undef,
) {
$real_value = getvar('param1', $facts['some_fact'])
}
Though, in the real world, I'd just put the default in the class parameter, like this:
class foo (
String $param1 = $facts['some_fact'],
) {
}bastelfreak
02/10/2023, 7:27 PM## hack pluginsync as file resource. only required for `puppet apply` usage
# this works by accident with puppet agent, but only on the puppetserver
# it breaks puppet agent on other systems, so we need to guard it
if $trusted['authenticated'] == 'local' {
file { $::settings::libdir: # lint:ignore:top_scope_facts
ensure => directory,
source => 'puppet:///plugins', # lint:ignore:puppet_url_without_modules
recurse => true,
purge => true,
backup => false,
noop => false,
}
}
Also I was told that this hack isn't required anymore for puppet apply, but I had no time yet to verify. Maybe it works out of the box now with a correct modulepathSlackbot
02/10/2023, 7:28 PMrusty
02/10/2023, 7:28 PMCVQuesty
02/10/2023, 7:28 PMrusty
02/10/2023, 7:28 PMCVQuesty
02/10/2023, 7:30 PMSlackbot
02/10/2023, 7:31 PMrusty
02/10/2023, 7:32 PM2018-01-29Slackbot
02/10/2023, 7:36 PMSlackbot
02/10/2023, 7:49 PMJason Grammenos
02/10/2023, 7:49 PMKen
02/10/2023, 9:19 PMKen
02/10/2023, 9:19 PMMassimiliano (Max)
02/11/2023, 2:41 PM/my_package/my_package-0.5.tar.gzMassimiliano (Max)
02/11/2023, 2:41 PMMassimiliano (Max)
02/11/2023, 8:05 PM/my_package/my_package-0.5.tar.gzNathan Ward
02/12/2023, 2:55 AMexample42/network is deprecated, and suggests puppet/network as a replacement, but it will only configure a single IP address per interface, so if you have an interface which is IPv4 and IPv6, you have to configure one of them as an alias interface, which is not how it works these days.Dr Bunsen Honeydew
02/12/2023, 2:55 AMexample42-network module at https://forge.puppet.com/example42/network?src=slack&channel=puppetNathan Ward
02/12/2023, 3:10 AMYury Bushmelev
02/12/2023, 4:18 AM