Pat Riehecky
06/06/2022, 4:36 PMbastelfreak
06/06/2022, 4:41 PMbundle install --path .vendor/ on ruby 2.5 and newer should work without issues.bastelfreak
06/06/2022, 4:42 PMPat Riehecky
06/06/2022, 4:43 PM--path .vendor start getting recommended, this is the first I've seen itPat Riehecky
06/06/2022, 4:44 PM[riehecky@leibniz puppet-logrotate]$ ls -a
. .editorconfig .github metadata.json README.md .sync.yml
.. files .gitignore .msync.yml .rspec templates
CHANGELOG.md .fixtures.yml HISTORY.md .overcommit.yml .rspec_parallel types
CONTRIBUTORS Gemfile LICENSE .pmtignore .rubocop.yml
Dockerfile .git manifests Rakefile spec
[riehecky@leibniz puppet-logrotate]$ bundle install --path .vendor/
[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local path '.vendor/'`, and stop using this flag
Fetching gem metadata from <https://rubygems.org/>.......
Resolving dependencies......
<snip>[riehecky@leibniz puppet-logrotate]$ bundle exec rake rubocop
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
Running RuboCop...
wrong number of arguments (given 5, expected 1)
/usr/share/ruby/psych.rb:323:in `safe_load'Dr Bunsen Honeydew
06/06/2022, 4:44 PMpuppet-logrotate module at https://forge.puppet.com/puppet/logrotate?src=slack&channel=voxpupuliPat Riehecky
06/06/2022, 4:45 PM[riehecky@leibniz puppet-logrotate]$ ls -a
. .editorconfig .github metadata.json README.md .sync.yml
.. files .gitignore .msync.yml .rspec templates
CHANGELOG.md .fixtures.yml HISTORY.md .overcommit.yml .rspec_parallel types
CONTRIBUTORS Gemfile LICENSE .pmtignore .rubocop.yml
Dockerfile .git manifests Rakefile spec
[riehecky@leibniz puppet-logrotate]$ bundle install --path .vendor/
[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local path '.vendor/'`, and stop using this flag
Fetching gem metadata from <https://rubygems.org/>.......
Resolving dependencies......
<snip>[riehecky@leibniz puppet-logrotate]$ bundle exec rake rubocop
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
Running RuboCop...
wrong number of arguments (given 5, expected 1)
/usr/share/ruby/psych.rb:323:in `safe_load'Pat Riehecky
06/06/2022, 4:45 PMbastelfreak
06/06/2022, 4:45 PMbastelfreak
06/06/2022, 4:47 PMbundle exec rake test is the way to goPat Riehecky
06/06/2022, 4:48 PM./tmp/bar/puppet-logrotate/.vendor/ruby/3.1.0/gems/puppet-7.17.0/lib/puppet/parser/templatewrapper.rb:93: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments. then ruby core dumpsPat Riehecky
06/06/2022, 4:49 PMbastelfreak
06/06/2022, 4:50 PMbastelfreak
06/06/2022, 4:51 PMPat Riehecky
06/06/2022, 4:51 PMbastelfreak
06/06/2022, 4:51 PMPat Riehecky
06/06/2022, 4:51 PMbastelfreak
06/06/2022, 4:52 PMPat Riehecky
06/06/2022, 4:52 PM1) logrotate::conf => /etc/logrotate.conf is expected to contain File[/etc/logrotate.conf] with owner => "root", group => "root", ensure => "present", mode => "0644" and content =~ /\ninclude \/etc\/logrotate.d\n/
Failure/Error:
<http://is_expected.to|is_expected.to> contain_file('/etc/logrotate.conf').with(
'owner' => 'root',
'group' => 'root',
'ensure' => 'present',
'mode' => '0644'
).with_content(%r{\ninclude \/etc\/logrotate.d\n})
expected that the catalogue would contain File[/etc/logrotate.conf] with group set to "root" but it is set to "wheel", and parameter content set to /\ninclude \/etc\/logrotate.d\n/ but it is set to "# THIS FILE IS AUTOMATICALLY DISTRIBUTED BY PUPPET.\n# ANY CHANGES WILL BE OVERWRITTEN.\n\ncreate\nrotate 4\nweekly\n\n# configurable file rotations\ninclude /usr/local/etc/logrotate.d\n"
Diff:
@@ -1,4 +1,12 @@
-root
+wheel
-(?-mix:\ninclude \/etc\/logrotate.d\n)
+# THIS FILE IS AUTOMATICALLY DISTRIBUTED BY PUPPET.
+# ANY CHANGES WILL BE OVERWRITTEN.
+
+create
+rotate 4
+weekly
+
+# configurable file rotations
+include /usr/local/etc/logrotate.d
# ./spec/defines/conf_spec.rb:110:in `block (3 levels) in <top (required)>'
I'm not altering any code anywhere near this as near as I understand itSlackbot
06/06/2022, 4:54 PMOleksandr Lytvyn
06/06/2022, 6:07 PMNotice: /Stage[main]/Profile::Puppetserver/Exec[restart_puppet-webhook.service]/returns: executed successfully (corrective)
archive { "/tmp/webhook-go_${webhook_version}_linux_amd64.tar.gz":
ensure => present,
extract => true,
extract_path => '/opt/bitbucket-webhook',
source => "<https://github.com/voxpupuli/webhook-go/releases/download/v${webhook_version}/webhook-go_${webhook_version}_linux_amd64.tar.gz>",
checksum => $webhook_binary_checksum,
checksum_type => 'sha256',
creates => '/opt/bitbucket-webhook/webhook-go',
cleanup => false,
require => File['/opt/bitbucket-webhook'],
before => File['/opt/bitbucket-webhook/webhook-go'],
}
file { '/opt/bitbucket-webhook/webhook-go':
ensure => 'present',
owner => 'root',
group => 'root',
mode => '0750',
}
exec { 'restart_puppet-webhook.service':
path => ['/usr/bin', '/usr/sbin', '/bin'],
command => 'systemctl restart puppet-webhook.service',
subscribe => File['/opt/bitbucket-webhook/webhook-go'],
I tried to use next construction:
exec { 'restart_puppet-webhook.service':
path => ['/usr/bin', '/usr/sbin', '/bin'],
command => 'systemctl restart puppet-webhook.service',
subscribe => Archive["/tmp/webhook-go_${webhook_version}_linux_amd64.tar.gz"],
}
but it also trigger Exec refresh.
Is it expected? I would like not to trigger Exec "restart_puppet-webhook.service" action every time "puppet agent -t" runOleksandr Lytvyn
06/06/2022, 6:10 PMNotice: /Stage[main]/Profile::Puppetserver/Exec[restart_puppet-webhook.service]/returns: executed successfully (corrective)
archive { "/tmp/webhook-go_${webhook_version}_linux_amd64.tar.gz":
ensure => present,
extract => true,
extract_path => '/opt/bitbucket-webhook',
source => "<https://github.com/voxpupuli/webhook-go/releases/download/v${webhook_version}/webhook-go_${webhook_version}_linux_amd64.tar.gz>",
checksum => $webhook_binary_checksum,
checksum_type => 'sha256',
creates => '/opt/bitbucket-webhook/webhook-go',
cleanup => false,
require => File['/opt/bitbucket-webhook'],
before => File['/opt/bitbucket-webhook/webhook-go'],
}
file { '/opt/bitbucket-webhook/webhook-go':
ensure => 'present',
owner => 'root',
group => 'root',
mode => '0750',
}
exec { 'restart_puppet-webhook.service':
path => ['/usr/bin', '/usr/sbin', '/bin'],
command => 'systemctl restart puppet-webhook.service',
subscribe => File['/opt/bitbucket-webhook/webhook-go'],
I tried to use next construction:
exec { 'restart_puppet-webhook.service':
path => ['/usr/bin', '/usr/sbin', '/bin'],
command => 'systemctl restart puppet-webhook.service',
subscribe => Archive["/tmp/webhook-go_${webhook_version}_linux_amd64.tar.gz"],
}
but it also trigger Exec refresh.
Is it expected? I would like not to trigger Exec "restart_puppet-webhook.service" action every time "puppet agent -t" runvchepkov
06/06/2022, 6:15 PMrefreshonly => truebastelfreak
06/06/2022, 6:16 PMOleksandr Lytvyn
06/06/2022, 6:20 PMVoxBot
06/06/2022, 9:47 PMOleksandr Lytvyn
06/07/2022, 7:51 AM$webhook_version = lookup('profile::puppetserver::webhook_version', String, 'first', '1.0.0')
$webhook_binary_checksum = lookup('profile::puppetserver::webhook_binary_checksum', String, 'first', 'a949eed101ad5d66bcd53d3a3046ba4c68fd6f65f366c2276a674d25615ed1af')
archive { "/tmp/webhook-go_${webhook_version}_linux_amd64.tar.gz":
ensure => present,
extract => true,
extract_path => '/opt/bitbucket-webhook',
source => "<https://github.com/voxpupuli/webhook-go/releases/download/v${webhook_version}/webhook-go_${webhook_version}_linux_amd64.tar.gz>",
checksum => $webhook_binary_checksum,
checksum_type => 'sha256',
creates => '/opt/bitbucket-webhook/webhook-go',
cleanup => false,
require => File['/opt/bitbucket-webhook'],
before => File['/opt/bitbucket-webhook/webhook-go'],
notify => Service['puppet-webhook.service'],
}
I want to be able to upgrade/downgrade version of "webhook-go". Right now I can change values of $webhook_version and $webhook_binary_checksum to different versions aka:
$webhook_version = lookup('profile::puppetserver::webhook_version', String, 'first', '1.0.0')
$webhook_binary_checksum = lookup('profile::puppetserver::webhook_binary_checksum', String, 'first', 'a949eed101ad5d66bcd53d3a3046ba4c68fd6f65f366c2276a674d25615ed1af')
or
$webhook_version = lookup('profile::puppetserver::webhook_version', String, 'first', '1.0.1')
$webhook_binary_checksum = lookup('profile::puppetserver::webhook_binary_checksum', String, 'first', '7f1d26d6ecfe556778098db9456934430318f224aa0867965a0ef3d424fead3e')
But it actually doesn't change (upgrade/downgrade) actual version of binary '/opt/bitbucket-webhook/webhook-go'. And only way is to remove it, so module "archieve" will re-download tar gz and extract archieve.
Is there any way to actually change version (upgrade/downgrade) by providing different values via hiera?Oleksandr Lytvyn
06/07/2022, 7:53 AM$webhook_version = lookup('profile::puppetserver::webhook_version', String, 'first', '1.0.0')
$webhook_binary_checksum = lookup('profile::puppetserver::webhook_binary_checksum', String, 'first', 'a949eed101ad5d66bcd53d3a3046ba4c68fd6f65f366c2276a674d25615ed1af')
archive { "/tmp/webhook-go_${webhook_version}_linux_amd64.tar.gz":
ensure => present,
extract => true,
extract_path => '/opt/bitbucket-webhook',
source => "<https://github.com/voxpupuli/webhook-go/releases/download/v${webhook_version}/webhook-go_${webhook_version}_linux_amd64.tar.gz>",
checksum => $webhook_binary_checksum,
checksum_type => 'sha256',
creates => '/opt/bitbucket-webhook/webhook-go',
cleanup => false,
require => File['/opt/bitbucket-webhook'],
before => File['/opt/bitbucket-webhook/webhook-go'],
notify => Service['puppet-webhook.service'],
}
I want to be able to upgrade/downgrade version of "webhook-go". Right now I can change values of $webhook_version and $webhook_binary_checksum to different versions aka:
$webhook_version = lookup('profile::puppetserver::webhook_version', String, 'first', '1.0.0')
$webhook_binary_checksum = lookup('profile::puppetserver::webhook_binary_checksum', String, 'first', 'a949eed101ad5d66bcd53d3a3046ba4c68fd6f65f366c2276a674d25615ed1af')
or
$webhook_version = lookup('profile::puppetserver::webhook_version', String, 'first', '1.0.1')
$webhook_binary_checksum = lookup('profile::puppetserver::webhook_binary_checksum', String, 'first', '7f1d26d6ecfe556778098db9456934430318f224aa0867965a0ef3d424fead3e')
But it actually doesn't change (upgrade/downgrade) actual version of binary '/opt/bitbucket-webhook/webhook-go'. And only way is to remove it, so module "archieve" will re-download tar gz and extract archieve.
Is there any way to actually change version (upgrade/downgrade) by providing different values via hiera?bastelfreak
06/07/2022, 11:41 AMbastelfreak
06/07/2022, 11:41 AM