I'm running a server on FreeBSD 13.1. The configuration is managed by puppet. The last pkg upgrade replaced puppet6 with puppet7, which does not work for our setup based on Puppet 6 (~60 servers). So I decided to build Ruby 2.7 from source, and installed puppet as a Ruby Gem, which worked fine.
However, when I run the puppet agent, the following fact won't resolve
$::memory['system']['total']
When I run:
$ sudo puppet agent --test
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Operator '[]' is not applicable to an Undef Value. [...]
Therefore, I defined the following custom fact in $HOME/facter.d/memory.json:
{
"memory":
{
"system":
{
"total" : "32.00 GiB",
"total_bytes" : 34359738368
}
}
}
Which seems to work:
$ facter --external-dir $HOME/facter.d
[...]
memory => {
system => {
total => "32.00 GiB",
total_bytes => 34359738368
}
}
[...]
So I extended my puppet config (at /etc/puppetlabs/puppet/puppet.conf) by the following line:
factpath=/home/me/facter.d:/opt/puppetlabs/puppet/cache/lib/facter
With /home/me being my $HOME used above.
However, I still get the exact same error as above.
What is wrong here?
Update
I now downgraded to facter version 2.5.7 and use ::memorysize. This works, but when running sudo pupept agent --test, I get a new error message:
Error: Failed to apply catalog: Resource type 'Ssh_authorized_key' was not found