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

    Pat Riehecky

    06/06/2022, 4:36 PM
    I have literally never gotten the bundle tests to run on any system in the last decade....
  • b

    bastelfreak

    06/06/2022, 4:41 PM
    works without issues since ages for me.
    bundle install --path .vendor/
    on ruby 2.5 and newer should work without issues.
  • b

    bastelfreak

    06/06/2022, 4:42 PM
    if you see issues with the ruby setup on a vox pupuli module, let me know
  • p

    Pat Riehecky

    06/06/2022, 4:43 PM
    When did
    --path .vendor
    start getting recommended, this is the first I've seen it
  • p

    Pat Riehecky

    06/06/2022, 4:44 PM
    Copy code
    [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'
  • d

    Dr Bunsen Honeydew

    06/06/2022, 4:44 PM
    See the
    puppet-logrotate
    module at https://forge.puppet.com/puppet/logrotate?src=slack&amp;channel=voxpupuli
  • p

    Pat Riehecky

    06/06/2022, 4:45 PM
    Copy code
    [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'
  • p

    Pat Riehecky

    06/06/2022, 4:45 PM
    no real change on my end
  • b

    bastelfreak

    06/06/2022, 4:45 PM
    probably 5 years ago when I added it to our docs
  • b

    bastelfreak

    06/06/2022, 4:47 PM
    the issue in the logrotate PR are failing unit tests. so
    bundle exec rake test
    is the way to go
  • p

    Pat Riehecky

    06/06/2022, 4:48 PM
    I get about 8000 lines of
    ./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 dumps
  • p

    Pat Riehecky

    06/06/2022, 4:49 PM
    This is a brand new system I literally just installed yesterday where I've done zero configuration from the Fedora 36 defaults.
  • b

    bastelfreak

    06/06/2022, 4:50 PM
    ah ruby 3.1 is a bit new and not yet 100% supported in puppet :(
  • b

    bastelfreak

    06/06/2022, 4:51 PM
    maybe the real error message is sonewhere in the output
  • p

    Pat Riehecky

    06/06/2022, 4:51 PM
    Well, that at least explains why nothing works 🙂
  • b

    bastelfreak

    06/06/2022, 4:51 PM
    otherwise you can also see it on github
  • p

    Pat Riehecky

    06/06/2022, 4:51 PM
    On github it complains about suddenly package resources are not defined as expected, which is odd since I'm not touching any package resources in the patch
  • b

    bastelfreak

    06/06/2022, 4:52 PM
    https://github.com/voxpupuli/puppet-logrotate/runs/6759218380?check_suite_focus=true
  • p

    Pat Riehecky

    06/06/2022, 4:52 PM
    Copy code
    1) 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 it
  • s

    Slackbot

    06/06/2022, 4:54 PM
    This message was deleted.
    h
    p
    • 3
    • 4
  • o

    Oleksandr Lytvyn

    06/06/2022, 6:07 PM
    Hello, I have a question regarding https://forge.puppet.com/modules/puppet/archive Right now I have "webhook-go" binary in Bitbucket repository. Someone adviced me to move it out from Bitbucket and just download tar gz archieve and unpack it from GitHub directly. Technically code below resolved it. But --> After each "puppet agent -t" run Exec resource being triggered, which result in systemd unit to restart "webhook-go" service:
    Copy code
    Notice: /Stage[main]/Profile::Puppetserver/Exec[restart_puppet-webhook.service]/returns: executed successfully (corrective)
    Copy code
    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:
    Copy code
    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" run
    ✅ 1
  • o

    Oleksandr Lytvyn

    06/06/2022, 6:10 PM
    Hello, I have a question regarding https://forge.puppet.com/modules/puppet/archive Right now I have "webhook-go" binary in Bitbucket repository. Someone adviced me to move it out from Bitbucket and just download tar gz archieve and unpack it from GitHub directly. Technically code below resolved it. But --> After each "puppet agent -t" run Exec resource being triggered, which result in systemd unit to restart "webhook-go" service:
    Copy code
    Notice: /Stage[main]/Profile::Puppetserver/Exec[restart_puppet-webhook.service]/returns: executed successfully (corrective)
    Copy code
    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:
    Copy code
    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" run
  • v

    vchepkov

    06/06/2022, 6:15 PM
    Copy code
    refreshonly => true
  • b

    bastelfreak

    06/06/2022, 6:16 PM
    also I recommend not using the exec resource, but notify the service resource
    🙌 1
  • o

    Oleksandr Lytvyn

    06/06/2022, 6:20 PM
    Thanks a lot! I got rid of Exec resource, and added notify to trigger service resource -> it helped 🙂
  • v

    VoxBot

    06/06/2022, 9:47 PM
    god that's a lot of spam
  • o

    Oleksandr Lytvyn

    06/07/2022, 7:51 AM
    Hello, i have a question regarding https://forge.puppet.com/modules/puppet/archive - how does it handle when version of file/archieve changes? For example I have right now next code:
    Copy code
    $webhook_version         = lookup('profile::puppetserver::webhook_version', String, 'first', '1.0.0')
        $webhook_binary_checksum = lookup('profile::puppetserver::webhook_binary_checksum', String, 'first', 'a949eed101ad5d66bcd53d3a3046ba4c68fd6f65f366c2276a674d25615ed1af')
    Copy code
    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:
    Copy code
    $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
    Copy code
    $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?
  • o

    Oleksandr Lytvyn

    06/07/2022, 7:53 AM
    Hello, i have a question regarding https://forge.puppet.com/modules/puppet/archive - how does it handle when version of file/archieve changes? For example I have right now next code:
    Copy code
    $webhook_version         = lookup('profile::puppetserver::webhook_version', String, 'first', '1.0.0')
        $webhook_binary_checksum = lookup('profile::puppetserver::webhook_binary_checksum', String, 'first', 'a949eed101ad5d66bcd53d3a3046ba4c68fd6f65f366c2276a674d25615ed1af')
    Copy code
    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:
    Copy code
    $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
    Copy code
    $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?
  • b

    bastelfreak

    06/07/2022, 11:41 AM
    @raphink do you know people when can ping for https://github.com/camptocamp/puppet-catalog-diff ? We raised an issue and wrote an email two weeks ago but didn't have much success. We would like to migrate it to Vox Pupuli
  • b

    bastelfreak

    06/07/2022, 11:41 AM
    @raphink do you know people when can ping for https://github.com/camptocamp/puppet-catalog-diff ? We raised an issue and wrote an email two weeks ago but didn't have much success. We would like to migrate it to Vox Pupuli
1...596061...648Latest