Skip to content

Conversation

@martijndegouw
Copy link
Contributor

As far as I can tell Debian 10 still needs this work-around.

@martijndegouw martijndegouw requested a review from a team as a code owner March 1, 2021 10:31
@puppet-community-rangefinder
Copy link

apache::mod::dav_svn is a class

that may have no external impact to Forge modules.

This module is declared in 175 of 576 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

::apache::mod { 'dav_svn': }

if $::osfamily == 'Debian' and ! ($::operatingsystemmajrelease in ['6', '9', '16.04', '18.04']) {
if $::osfamily == 'Debian' and ! ($::operatingsystemmajrelease in ['6', '9', '10', '16.04', '18.04']) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like a workaround on some older Debian versions while the newer ones behave as you would expect. Perhaps it should be checked which versions need this. I'd expect Ubuntu 20.04 behaves the same as Debian 10.

Then you would get to something like:

Suggested change
if $::osfamily == 'Debian' and ! ($::operatingsystemmajrelease in ['6', '9', '10', '16.04', '18.04']) {
if $::osfamily == 'Debian' and $::operatingsystemmajrelease in ['7', '8', '14.04'] {

Untested, but I think you get the idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I got it. I also did found some patches from Debian for the dav_svn module which should fix this in the package itself, but the issue still reproduces on my Debian 10 testing machine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just checked. The Debian 10 package has pretty similar word-around in mods-available/dav_svn.load, but that file is overwritten by this puppet module.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must admit I haven't looked at the dav_svn module for ages. Perhaps you can write an acceptance test for the module so we know it really works rather than guessing? That also gives the best chance against regressions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will give a shot, It's not hard to reproduce since apache2 simply won't start when including apache::mod::dav_svn :D

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, those are the things that are fairly easy to test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the result of the acceptance test and looking at how Debian implemented their work-around it's safe to say that the whole version checking part of that if statement can be removed. Agreed?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that makes sense but it's probably good to check with the actual maintainers.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @martijndegouw and the assistance during the PR @ekohl . The test is great - allows us to check we haven't inadvertently stomp over some logic put in there for the older versions, as you said @ekohl .

@codecov-io
Copy link

Codecov Report

Merging #2135 (08fdb9b) into main (13f55bd) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2135   +/-   ##
=======================================
  Coverage   56.36%   56.36%           
=======================================
  Files          12       12           
  Lines         220      220           
=======================================
  Hits          124      124           
  Misses         96       96           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a67aa4...08fdb9b. Read the comment docs.

Comment on lines 14 to 33
it 'succeeds in installing the dav_svn module' do
apply_manifest(pp, catch_failures: true)
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add an idempotency check to this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not sure what you mean by this. Do you want to run the apply_manifest twice? To check if it fails/passes 2 times in a row?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied from another module:

  it 'applies with no errors' do
    apply_manifest(pp, catch_failures: true)
  end

  it 'applies a second time without changes' do
    apply_manifest(pp, catch_changes: true)
  end

@martijndegouw
Copy link
Contributor Author

martijndegouw commented Mar 4, 2021

Great, SLES 15 test is failing, on the exact same issue I have on my SLES server with the puppetlabs repo :/.
`Note: Signing data enables the recipient to verify that no modifications occurred after the data were signed. Accepting data with no, wrong or unknown signature can lead to a corrupted system and in extreme cases even to a system compromise.
Note: File 'repomd.xml' is the repositories master index file. It ensures the integrity of the whole repo.

Warning: This file was modified after it has been signed. This may have been a malicious change, so it might not be trustworthy anymore! You should not continue unless you know it's safe.

Signature verification failed for file 'repomd.xml' from repository 'Puppet 6 Nightly Repository sles 15 - x86_64'
`

@sanfrancrisko
Copy link
Contributor

Great, SLES 15 test is failing, on the exact same issue I have on my SLES server with the puppetlabs repo :/.
`Note: Signing data enables the recipient to verify that no modifications occurred after the data were signed. Accepting data with no, wrong or unknown signature can lead to a corrupted system and in extreme cases even to a system compromise.
Note: File 'repomd.xml' is the repositories master index file. It ensures the integrity of the whole repo.

Warning: This file was modified after it has been signed. This may have been a malicious change, so it might not be trustworthy anymore! You should not continue unless you know it's safe.

Signature verification failed for file 'repomd.xml' from repository 'Puppet 6 Nightly Repository sles 15 - x86_64'
`

😞 Would this be a consistently reproducible error? Re-running seems to have gotten me past that issue now, but, if you're experiencing that pretty consistently, I'd like to get the issue raised with our Agent team to look in to.

@sanfrancrisko
Copy link
Contributor

PR looks good, but there seems to be a unit test failure. I can't see why we wouldn't still generate a catalog with this File resource when your change is applied. Will have another look at it but just highlighting it here in case yourself or @ekohl figure it out before me.

The work-around that distros apply for dav_svn/authz_svn module loading
issue is overwritten by this module. Always apply the work-around.
@martijndegouw
Copy link
Contributor Author

PR looks good, but there seems to be a unit test failure. I can't see why we wouldn't still generate a catalog with this File resource when your change is applied. Will have another look at it but just highlighting it here in case yourself or @ekohl figure it out before me.

Sorry, I misted that one. I've updated the unit test as well.

@david22swan
Copy link
Member

@martijndegouw This PR looks good to me, thanks for putting in the work.

@david22swan david22swan merged commit c2d7b9d into puppetlabs:main Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants