Niek de Jong
03/29/2024, 1:52 PM--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 againbastelfreak
03/29/2024, 1:52 PMbastelfreak
03/29/2024, 1:52 PMNiek de Jong
03/29/2024, 1:54 PM--link
) won't take that long. I'm used to using --link
when upgrading 500G+ databases with limited diskspace. PuppetDB is a fraction of thatbastelfreak
03/29/2024, 1:55 PMBrian Schonecker
03/29/2024, 2:08 PMbastelfreak
03/29/2024, 2:08 PMbastelfreak
03/29/2024, 2:08 PMbastelfreak
03/29/2024, 2:08 PMBrian Schonecker
03/29/2024, 2:08 PMWim Korevaar
03/29/2024, 2:31 PMarchive { '/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.
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?Joel Wilson
03/29/2024, 3:28 PMversioncmp()
narrative:
# 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
Joel Wilson
03/29/2024, 3:28 PMirb(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">
Joel Wilson
03/29/2024, 3:29 PMdef 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?
Joel Wilson
03/29/2024, 3:31 PMversioncmp()
issue, I had to first process the version string with (?:.*:)?(\d+(\.\d+)*)(?:[+~-].*)?
Joel Wilson
03/29/2024, 3:31 PMJoel Wilson
03/29/2024, 3:32 PMvchepkov
03/29/2024, 3:34 PMvchepkov
03/29/2024, 3:36 PMvchepkov
03/29/2024, 3:38 PMversioncmp($pkg_version, '8'),
if epoch is involved 🙂, it's ambiguouscsharpsteen
03/29/2024, 3:38 PMversioncmp()
is a very generic function and this sort of stuff is deep "inside Debian baseball".
Apt provider should definitely handle it though.Joel Wilson
03/29/2024, 3:40 PMYury Bushmelev
03/29/2024, 3:49 PMapt::pkg_versioncmp()
function which will consider epoch 🙂Yury Bushmelev
03/29/2024, 3:50 PMJoel Wilson
03/29/2024, 3:51 PMJoel Wilson
03/29/2024, 3:52 PMJoel Wilson
03/29/2024, 3:53 PMLumiere
03/29/2024, 3:55 PMJoel Wilson
03/29/2024, 4:02 PMLumiere
03/29/2024, 4:06 PM