https://www.puppet.com/community logo
Join SlackCommunities
Powered by
# puppet-enterprise
  • v

    Venu A

    05/12/2022, 9:41 PM
    what is the easy way to write puppet code that fails and trigers a notify?
  • y

    Yorokobi

    05/12/2022, 9:44 PM
    Several options: https://puppet.com/docs/puppet/7/function.html
  • v

    vchepkov

    05/17/2022, 6:33 PM
    Typically you notify, then fail 🙂
  • v

    vchepkov

    05/18/2022, 5:51 PM
    There seems to be a bug in PE installer that fails to install agent if bolt is used. I am using puppetlabs/peadm module and I reported issue here, but I am not entirely sure if it's PE problem, peadm problem or bolt problem What it boils down to this error, while installing agent on replica :
    Copy code
    E: '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
    Copy code
    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 issue
  • c

    cdenneen

    05/18/2022, 8:42 PM
    what's the best way to avoid this:
    Copy code
    Error: Facter: error while resolving custom fact "git_version": execution of command "git --version" failed: command not found.
    here is the fact:
    Copy code
    ❯ 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
  • b

    bastelfreak

    05/18/2022, 8:47 PM
    check https://github.com/puppetlabs/puppetlabs-git/blob/master/lib/facter/git_version.rb
    👍 1
  • b

    bastelfreak

    05/18/2022, 8:47 PM
    check https://github.com/puppetlabs/puppetlabs-git/blob/master/lib/facter/git_version.rb
  • c

    csharpsteen

    05/18/2022, 8:52 PM
    Or:
    confine { Facter::Core::Execution.which('git') }
    👍 2
  • s

    Slackbot

    05/19/2022, 4:47 AM
    This message was deleted.
    m
    d
    • 3
    • 4
  • v

    vchepkov

    05/23/2022, 3:16 PM
    lets hope it's a good news
  • r

    Ross De

    05/24/2022, 6:21 PM
    who knew perforce had that much $
  • s

    Skylar Thompson

    05/24/2022, 8:39 PM
    As long as we're still allowed to use git...
    mandalorian 1
  • j

    John W Smith

    05/24/2022, 8:48 PM
    TBH, it would probably make economic sense for them to move the PuppetLabs repos to their Helix TeamHub platform which supports git.
  • b

    bastelfreak

    05/24/2022, 8:52 PM
    that sounds like the facter 2 -> facter 3 idea to swirch from ruby to c++. you might gain something but lose a ton of contributors
  • b

    bastelfreak

    05/24/2022, 8:53 PM
    I dont think many people want to switch from github to something else
  • j

    Jeremy Mill

    05/24/2022, 8:58 PM
    there are no plans to change off of github anytime soon if ever
    👆 1
    😌 1
  • c

    csharpsteen

    05/24/2022, 9:12 PM
    Yup. There are other Perforce units using GitHub, GitLab, etc. No mandate to use Helix.
  • s

    Slackbot

    05/24/2022, 11:57 PM
    This message was deleted.
    c
    b
    • 3
    • 3
  • c

    Chris H.

    05/24/2022, 11:58 PM
    Ok, I've been hitting my head on this for a while so maybe I can find some help here. I have a homelab Puppet Enterprise instance and Code Manager/r10k has stopped working reliably. Most runs fail with a "free(): invalid pointer" error, but if I repeat the deployment command several times it eventually runs successfully. I've disabled Code Manager and run r10k directly, I've reinstalled Puppet Enterprise, built a new VM, pointed to a clean control_repository, Run a local VM on I'm running out of ideas. Running PE 2021.6.0, tried both Ubuntu LTS 18.04 and 20.04
  • s

    Slackbot

    05/25/2022, 7:58 AM
    This message was deleted.
    m
    b
    s
    • 4
    • 40
  • m

    Marty Ewings

    05/25/2022, 12:13 PM
    i always forget what the default is, it not infinite its just like 150 or something, let me confirm ….
  • i

    IlovPuppet

    05/25/2022, 4:25 PM
    Hello, I’m trying to write a simple custom fact as below. I’m getting the desired result. However, for Apache-cassandra type, I’m getting one extra empty line in the output. How do I remove that extra line? Output as below: cassandra-apache-2.9 Empty_Line
    Facter.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
  • w

    whatsaranjit

    05/25/2022, 4:39 PM
    You can add
    | tr -d "\n"
    on the end of your bash commands.
  • w

    whatsaranjit

    05/25/2022, 4:41 PM
    Or use the ruby
    chomp()
    function.
    👍 1
  • w

    whatsaranjit

    05/25/2022, 4:42 PM
    Copy code
    [1] pry(main)> "teststring\n".chomp
    => "teststring"
  • v

    vchepkov

    05/25/2022, 4:45 PM
    on related note, what one should use nowadays,
    Facter::Core::Execution.execute
    or
    Facter::Util::Resolution.exec
    ?
  • v

    vchepkov

    05/25/2022, 4:48 PM
    opinion seems to be evenly split in modules I use
    Copy code
    [root@puppet facter]# cat *|grep -c Facter::Core::Execution
    57
    [root@puppet facter]# cat *|grep -c Facter::Util::Resolution
    53
  • c

    csharpsteen

    05/25/2022, 4:55 PM
    Facter::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.).
    ✔️ 2
  • c

    csharpsteen

    05/25/2022, 5:00 PM
    Looks like
    Facter::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.
    👍 1
1...789...73Latest