-
-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add yum::copr resource to handle COPR repositories. #215
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good case for an acceptance test as well I'd say.
manifests/copr.pp
Outdated
# } | ||
# | ||
define yum::copr ( | ||
String $copr_repo = $title, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable $repo
is proably enough since it's already in yum::copr
type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, I changed that in the last force push 👍 .
Enum['enabled', 'disabled', 'removed'] $ensure = 'enabled', | ||
) { | ||
$prereq_plugin = $facts['package_provider'] ? { | ||
'dnf' => 'dnf-plugins-core', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always prefer to make the future, dnf in this case, the default case since it's more obvious what code needs removing once yum is gone from the universe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea, thanks for the suggestion! I've also addressed this in the last push.
Indeed it is. I've addressed all comments apart from the acceptance test, will look into this later this week. |
manifests/copr.pp
Outdated
# } | ||
# | ||
define yum::copr ( | ||
String $repo = $title, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add puppet-strings like documentation for the new parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in the last force-push, really appreciate all the feedback from review, since I'm not yet used to most of the scaffolding and test infrastructure, and you are pushing me to read into the correct things 👍 .
b152e50
to
5a4360b
Compare
I've now fixed the Rubocop offenses in the existing test, and added an acceptance test. I don't have a box at hand (yet) to run the acceptance test, but I think it should work — CI will show ;-). |
Nice, the acceptance test found a real bug: I have fixed that in the last force-push by ensuring a COPR repository is added before disabling it, if Another issue was that the So I hope this might be the last iteration :-). |
One of the problems with this if you are running with resources{'yumrepo':
purge => true,
} The repo file will be deleted won't it? I don't see a good way around that. |
Indeed...
Same here, at least not as long as we want to use the official way (via Good ideas are very welcome. |
31033d7
to
8db4120
Compare
Sorry for the multiple force-pushes, I found a small logic issue in the last commit and fixed it — if there is any good proposal on how to upstream this, fixing / documenting the issue @traylenator pointed out, please let me know. |
@olifre force pushes are fine. Can you take a look at the failing CI jobs? |
792e781
to
d1902a1
Compare
Thanls, I think I fixed all CI issues, the remaining issue seems to be a fluke of the GitHub actions runner ( |
d1902a1
to
04316a8
Compare
@bastelfreak That did the trick, now all is green 😄 . |
@bastelfreak It seems CI went red again after you re-ran it yesterday, but checking the logs, that seems like an issue with the runners, correct? |
Given there's no sensible way around this and it only affects particular configurations I would just document it. https://forge.puppet.com/modules/crayfishx/purge/readme gives an example in fact. |
Thanks for confirming! The names of What do you think about the documentation addendum I added in the preceding commit? |
0675c06
to
5da2f01
Compare
I have finally come around to also regenerate |
manifests/copr.pp
Outdated
'dnf' => 'dnf-plugins-core', | ||
default => 'yum-plugin-copr', | ||
} | ||
stdlib::ensure_packages([$prereq_plugin]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please introduce a new param like $manage_prereq_plugin and wrap an if condition around thr function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes a lot of sense, done and force-pushed.
COPR (Cool Other Package Repo) is a Fedora project for third-party package repositories.
COPR (Cool Other Package Repo) is a Fedora project for third-party package repositories, see:
https://copr.fedorainfracloud.org/
Pull Request (PR) description
This PR adds support to manage COPR repositories via a new
yum::copr
resource.Documentation and test are included.
This Pull Request (PR) fixes the following issues
Fixes #149