Joshua Smeda
12/13/2022, 1:20 PMJoshua Smeda
12/13/2022, 1:24 PM:latest ?Joshua Smeda
12/13/2022, 1:26 PMJoshua Smeda
12/13/2022, 1:30 PMDr Bunsen Honeydew
12/13/2022, 2:45 PMSlackbot
12/13/2022, 3:01 PMDr Bunsen Honeydew
12/13/2022, 3:45 PMwoolfy
12/13/2022, 4:38 PMramindk
12/13/2022, 5:28 PMapt-get update && etc etc or just populating all the service accounts if you're not using ldap/sssd for that. Might help cut down on the time in Puppet.CVQuesty
12/13/2022, 5:56 PMCVQuesty
12/13/2022, 5:56 PMCVQuesty
12/13/2022, 5:56 PMCVQuesty
12/13/2022, 5:57 PMwoolfy
12/13/2022, 6:28 PMhbui
12/13/2022, 6:31 PMSlackbot
12/13/2022, 8:35 PMnatemccurdy
12/13/2022, 8:39 PMSlackbot
12/13/2022, 8:44 PMnatemccurdy
12/13/2022, 8:46 PM$namesmortex
12/13/2022, 8:47 PM$module_name ?Slackbot
12/13/2022, 8:47 PMSlackbot
12/13/2022, 9:10 PMnatemccurdy
12/13/2022, 9:18 PMnoop metaparameter of Puppet?
Or do you mean something like Python's pass which just evaluates to nothing and continues on?
I'm gonna assume the latter because Puppet errors out on branches of an if statement that don't evaluate to anything and I'm guessing you're hitting that error?natemccurdy
12/13/2022, 9:22 PMif statement that produces no value anymore. Weird 🤷natemccurdy
12/13/2022, 9:27 PMfacts is a reserved word and cannot be defined in local scopes, it only ever exists in "top scope". So there will never be any ambiguity in the variable named factssmortex
12/13/2022, 11:07 PMclass profile::base {
include "profile::base::${fact('kernel')}"
# [...]
}Yury Bushmelev
12/14/2022, 2:35 AMYury Bushmelev
12/14/2022, 2:35 AMnatemccurdy
12/14/2022, 4:59 AMsoftware fact would be better as a JSON file. Like this:
$ cat /etc/puppetlabs/facter/facts.d/software.json
{
"software": [
"Firefox",
"Opera",
"Google Chrome",
"Nmap"
],
"foo": "bar"
}
Note that this creates two facts:
• One called software, that is an Array of Strings.
• One called foo, that is a String.
Using those facts would look something like this:
$ cat fact_test_json.pp
notice("foo resolves to: ${facts.get('foo')}")
# Iterate over each array item in the `software` fact, then notice() it:
$facts.get('software').each |$package_name| {
notice($package_name)
}
Applying that Puppet code looks like this:
$ sudo puppet apply fact_test.pp
Notice: Scope(Class[main]): foo resolves to: bar
Notice: Scope(Class[main]): Firefox
Notice: Scope(Class[main]): Opera
Notice: Scope(Class[main]): Google Chrome
Notice: Scope(Class[main]): Nmap
Notice: Compiled catalog for nate.localdomain in environment production in 0.05 seconds
Notice: Applied catalog in 0.01 secondsnatemccurdy
12/14/2022, 4:59 AMsoftware fact would be better as a JSON file. Like this:
$ cat /etc/puppetlabs/facter/facts.d/software.json
{
"software": [
"Firefox",
"Opera",
"Google Chrome",
"Nmap"
],
"foo": "bar"
}
Note that this creates two facts:
• One called software, that is an Array of Strings.
• One called foo, that is a String.
Using those facts would look something like this:
$ cat fact_test_json.pp
notice("foo resolves to: ${facts.get('foo')}")
# Iterate over each array item in the `software` fact, then notice() it:
$facts.get('software').each |$package_name| {
notice($package_name)
}
Applying that Puppet code looks like this:
$ sudo puppet apply fact_test_json.pp
Notice: Scope(Class[main]): foo resolves to: bar
Notice: Scope(Class[main]): Firefox
Notice: Scope(Class[main]): Opera
Notice: Scope(Class[main]): Google Chrome
Notice: Scope(Class[main]): Nmap
Notice: Compiled catalog for nate.localdomain in environment production in 0.05 seconds
Notice: Applied catalog in 0.01 seconds