Venu A
05/12/2022, 9:41 PMYorokobi
05/12/2022, 9:44 PMvchepkov
05/17/2022, 6:33 PMvchepkov
05/18/2022, 5:51 PME: 'curl --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem -o /tmp/tmp.7BTJ4LYjrj -L --write-out %{http_code} -s <https://primary.example.com:8140/packages/2021.5.0/el-8-x86_64.bash> ' failed (exit_code: 60)
Error code 60 attempting to reach <https://primary.example.com:8140/packages/2021.5.0/el-8-x86_64.bash>
from man curl
60 Peer certificate cannot be authenticated with known CA certificates.
since ca.pem is the only 'unknown' component in this command, I modified peadm a bit to stub ca.pem and crl.pem prior running install.bash. After that plan succeeds every time. So, some weird condition prevents installer to populate this file properly (I assume installer does). I tried both installers, recent PE2019 and PE2021, same issuecdenneen
05/18/2022, 8:42 PMError: Facter: error while resolving custom fact "git_version": execution of command "git --version" failed: command not found.
here is the fact:
❯ more lib/facter/git_version.rb
# frozen_string_literal: true
Facter.add(:git_version) do
# confine :kernel => 'Linux'
# <https://puppet.com/docs/puppet/latest/fact_overview.html>
setcode do
Facter::Core::Execution.execute('git --version').split.last.delete('()')
end
end
bastelfreak
05/18/2022, 8:47 PMbastelfreak
05/18/2022, 8:47 PMcsharpsteen
05/18/2022, 8:52 PMconfine { Facter::Core::Execution.which('git') }
Slackbot
05/19/2022, 4:47 AMvchepkov
05/23/2022, 3:16 PMRoss De
05/24/2022, 6:21 PMSkylar Thompson
05/24/2022, 8:39 PMJohn W Smith
05/24/2022, 8:48 PMbastelfreak
05/24/2022, 8:52 PMbastelfreak
05/24/2022, 8:53 PMJeremy Mill
05/24/2022, 8:58 PMcsharpsteen
05/24/2022, 9:12 PMSlackbot
05/24/2022, 11:57 PMChris H.
05/24/2022, 11:58 PMSlackbot
05/25/2022, 7:58 AMMarty Ewings
05/25/2022, 12:13 PMIlovPuppet
05/25/2022, 4:25 PMFacter.add(:cassandra_type) do
confine :kernel => :Linux
setcode do
if Dir.exist?('/etc/dse')
dse = Facter::Util::Resolution.exec('/bin/nodetool version| head -1 | awk {\'print $3\'}')
"cassandra-dse-#{dse}"
elsif !Dir.glob("/apps/cassandra/apache-cassandra-*/bin/nodetool").empty?
nodetool = Dir.glob("/apps/cassandra/apache-cassandra-*/bin/nodetool")[0]
apache = %x{#{nodetool} -Dcom.sun.jndi.rmiURLParsing=legacy version | awk {\'print $2\'}}
"cassandra-apache-#{apache}"
end
end
end
whatsaranjit
05/25/2022, 4:39 PM| tr -d "\n"
on the end of your bash commands.whatsaranjit
05/25/2022, 4:41 PMchomp()
function.whatsaranjit
05/25/2022, 4:42 PM[1] pry(main)> "teststring\n".chomp
=> "teststring"
vchepkov
05/25/2022, 4:45 PMFacter::Core::Execution.execute
or Facter::Util::Resolution.exec
?vchepkov
05/25/2022, 4:48 PM[root@puppet facter]# cat *|grep -c Facter::Core::Execution
57
[root@puppet facter]# cat *|grep -c Facter::Util::Resolution
53
csharpsteen
05/25/2022, 4:55 PMFacter::Core::Execution.execute
has broad compatibility across all Facter versions. I don’t see Facter::Util::Resolution.exec
mentioned in the Facter 4 release notes, so offhand I wouldn’t use it unless it had some feature that the other did not (like easily setting environment variables, splitting stderr from stdout, passing stdin, setting a timeout, etc.).csharpsteen
05/25/2022, 5:00 PMFacter::Util::Resolution
just passes .exec
through to `Facter:Core:Execution`:
https://github.com/puppetlabs/facter/blob/main/lib/facter/custom_facts/util/resolution.rb#L21-L31
So, it’s all Facter::Core::Execution
in the end.