https://www.puppet.com/community logo
Join Slack
Powered by
# puppet
  • n

    Niek de Jong

    03/29/2024, 1:52 PM
    I know
    --link
    will deny me from going back to previous PSQL versions, but luckily i'm not testing on the actual server, but on a clone of said server, with snapshots. So if it breaks, i simply revert the snapshot and try again
  • b

    bastelfreak

    03/29/2024, 1:52 PM
    ah okay
  • b

    bastelfreak

    03/29/2024, 1:52 PM
    smart 😄
  • n

    Niek de Jong

    03/29/2024, 1:54 PM
    Although i think that the normal upgrade (without
    --link
    ) won't take that long. I'm used to using
    --link
    when upgrading 500G+ databases with limited diskspace. PuppetDB is a fraction of that
  • b

    bastelfreak

    03/29/2024, 1:55 PM
    and if you've old reports/dead nodes you can even remove them from the DB before doing an upgrade
    💡 1
  • b

    Brian Schonecker

    03/29/2024, 2:08 PM
    I just installed pgsql 16 and my puppetdb/puppetboard are doing fine as far as I can tell.
  • b

    bastelfreak

    03/29/2024, 2:08 PM
    but what's your puppetdb version? 😄
  • b

    bastelfreak

    03/29/2024, 2:08 PM
    puppetdb 8 works fine with it
  • b

    bastelfreak

    03/29/2024, 2:08 PM
    but 6? should be tested
  • b

    Brian Schonecker

    03/29/2024, 2:08 PM
    puppetdb-7.17.1-1.el8.noarch
  • w

    Wim Korevaar

    03/29/2024, 2:31 PM
    Maybe I'm just overseeing something simple, but I want to always extract a zipfile, when it is renewed in the source, but somehow It just doesn't.
    Copy code
    archive { '/tmp/file.zip':
      ensure        => present,
      source        => "${source}/file.zip",
      extract       => true,
      extract_path  => "/tmp/foo/",
      user          => $user,
    }
    When the files already exist in /tmp/foo, nothing happens. Even when I first make sure the zipfile changes by first using file and then archive, it doesn't work. Unless I remove the files in the extract_path folder.
    Copy code
    file { '/tmp/file.zip':
      ensure => file,
      mode   => '0750',
      owner  => $user,
      source => "${source}/file.zip",
    }
    archive { '/tmp/file.zip':
      ensure        => present,
      source        => "/tmp/file.zip",
      extract       => true,
      extract_path  => "/tmp/foo/",
      user          => $user,
    }
    I tried adding a notify and extract_flags, but that doesn't work. Should I skip the archive and just do an exec?
    b
    v
    +2
    • 5
    • 29
  • j

    Joel Wilson

    03/29/2024, 3:28 PM
    We've run into an issue with the apt package provider and packages with an epoch of 0 (zero). And somewhat related to that `versioncmp()`'s inability to support it, too. First, the
    versioncmp()
    narrative:
    Copy code
    # cat /tmp/test.pp
    $pkg_version = '7:8.2.2+ds-225736~fakeco'
    
    notify { 'cmp_output':
      message => versioncmp($pkg_version, '8'),
    }
    # puppet apply /tmp/test.pp
    Notice: Compiled catalog for <http://server.example.com|server.example.com> in environment production in 0.01 seconds
    Notice: /Stage[main]/Main/Notify[cmp_output]/message: current_value 'absent', should be -1 (noop)
    Notice: Class[Main]: Would have triggered 'refresh' from 1 event
    Notice: Stage[main]: Would have triggered 'refresh' from 1 event
    Notice: Applied catalog in 0.07 seconds
  • j

    Joel Wilson

    03/29/2024, 3:28 PM
    Then the apt package provider:
    Copy code
    irb(main):012:0> match, epoch, upstream_version, debian_revision = "1.10.1-223975".match(REGEX_FULL_RX)
    => #<MatchData "1.10.1-223975" 1:nil 2:"1.10.1" 3:"223975">
    irb(main):013:0> match, epoch, upstream_version, debian_revision = "0:1.10.1-223975".match(REGEX_FULL_RX)
    => #<MatchData "0:1.10.1-223975" 1:"0" 2:"1.10.1" 3:"223975">
  • j

    Joel Wilson

    03/29/2024, 3:29 PM
    This is from the code:
    Copy code
    def self.parse(ver)
          raise ValidationFailure, "Unable to parse '#{ver}' as a string" unless ver.is_a?(String)
    
          match, epoch, upstream_version, debian_revision = *ver.match(REGEX_FULL_RX)
    
          raise ValidationFailure, "Unable to parse '#{ver}' as a debian version identifier" unless match
    
          new(epoch.to_i, upstream_version, debian_revision).freeze
        end
    [...]
        def eql?(other)
          other.is_a?(self.class) &&
            @epoch.eql?(other.epoch) &&
            @upstream_version.eql?(other.upstream_version) &&
            @debian_revision.eql?(other.debian_revision)
        end
        alias == eql?
  • j

    Joel Wilson

    03/29/2024, 3:31 PM
    Two issues, but kind of related. For the
    versioncmp()
    issue, I had to first process the version string with
    (?:.*:)?(\d+(\.\d+)*)(?:[+~-].*)?
  • j

    Joel Wilson

    03/29/2024, 3:31 PM
    The package provider issue is that it keeps not seeing the installed version as the same as the one in the repo. We've resolved it temporarily by publishing the package without an epoch.
  • j

    Joel Wilson

    03/29/2024, 3:32 PM
    And now that I see the spam I just dropped, I wish I'd created a thread on the first post to drop that all into. 😞
  • v

    vchepkov

    03/29/2024, 3:34 PM
    I don't think it's fair to expect for versioncmp to deal with intricacies of a package version. it only deals with SemVer
  • v

    vchepkov

    03/29/2024, 3:36 PM
    you would have to split epoch and the rest in two parts and compare them separately
  • v

    vchepkov

    03/29/2024, 3:38 PM
    I wouldn't know how to answer this question
    versioncmp($pkg_version, '8'),
    if epoch is involved 🙂, it's ambiguous
  • c

    csharpsteen

    03/29/2024, 3:38 PM
    Aye,
    versioncmp()
    is a very generic function and this sort of stuff is deep "inside Debian baseball". Apt provider should definitely handle it though.
  • j

    Joel Wilson

    03/29/2024, 3:40 PM
    Yeah. Maybe a helper function specific to apt package versioning could be envisioned, I guess. My workaround is fine. The other issue with package "flapping" is annoying, though.
  • y

    Yury Bushmelev

    03/29/2024, 3:49 PM
    time to implement
    apt::pkg_versioncmp()
    function which will consider epoch 🙂
  • y

    Yury Bushmelev

    03/29/2024, 3:50 PM
    (and find that puppet-agent package for Debian 12 has lower version than for Puppet 11 (which has lower version than for Puppet 10))
  • j

    Joel Wilson

    03/29/2024, 3:51 PM
    Was that last a kind of quip or perhaps involved in why the provider isn't doing this right?
  • j

    Joel Wilson

    03/29/2024, 3:52 PM
    My colleague looked at the code in Github and it looks like it hasn't changed in 5 years.
  • j

    Joel Wilson

    03/29/2024, 3:53 PM
    Assuming we write a fix and submit a PR, how would one operate from their own version until it was merged? Some Gemfile override somewhere?
  • l

    Lumiere

    03/29/2024, 3:55 PM
    honestly, you get the PR merged then poke the puppet folks to cut you a release, which they tend to be good about 🙂
  • j

    Joel Wilson

    03/29/2024, 4:02 PM
    I've had my PRs sit for awhile, too. I just would like a way to operate while waiting.
  • l

    Lumiere

    03/29/2024, 4:06 PM
    you could always just use your fork via git in r10k
1...413414415...428Latest