-
-
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
Support paramatized yum::versionlock #169
Conversation
Currently if yum::versionlock{'0:bash-4.1.2-9.el6_2.x86_64':} is used this compiles on CentOS 8 but is almost certainly not what was wanted. In principle could ditch the |
6278d20
to
882f2e8
Compare
I tried to enable CentOS 8 accept tests but the framework hangs early. |
IMHO, |
It is in the sense you can ignore it. On 8 you get the new behaviour. You can choose to get the new behaviour on 7 as well with $package_provider is is totally used to decide a yum or dnf style format. |
Not sure why you would ever set 'future' on EL7, since it will render configuration invalid. Ah, I think I got what you are trying to do. IMHO, instead of adding 'future' attribute, why not deduct it from the fact that any of the new attributes are set instead of undef? |
Sorry for delay - long weekend here.
My first iteration of this I set arch, release version to undef as default and then used one of them being set to infer we were in modern mode. I changed as I prefer the Can I draw your attention to the
Just to confirm I my motivation was to avoid maintaining if versioncmp($facts['os']['release']['version'],'7') <= 0 {
yum::versionlock('0:bash-1.2.3.el6':}
} else {
yum::versionlock('bash':
version => '1.2.3',
release => 'el6',
}
} Instead folk can just do for 6 , 7 and 8 yum::versionlock('bash':
version => '1.2.3',
release => 'el6',
future => true,
} with this patch as it stands people have the choice of doing either above. |
In principle this patch supports someone installing dnf on CentOS 7 as well which is now available. Can't comment on the rest of the module mind you. |
I understand. IMHO, you can set default value for |
Oh, haven't realized that. It's not in any major repositories. In this case maybe parameter should be |
Seems sensibe. Indeed I can't think of use case where you would set release to something and leave version as I'll make those changes.
I think we would have to assume that |
If this new parameter is just to accommodate EL7 users with dnf installed, then disregard my last comment. package_provider comes from stdlib module, but it just uses logic from the puppet itself According to it, package_provider will be set to yum on EL7 |
Another option is to drop the old format and make this incompatible change release. |
You should probably remove that future attribute, since you don't use it anymore. |
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.
The actual code change looks ok. I'd like to see some tests for the type aliases. https://rspec-puppet.com/documentation/type_aliases/ makes this very easy to test. I'm mostly interested because I don't remember if Pattern
needs ^
and $
or if it's a full match so the it { is_expected.to allow_value('-a')
for RpmVersion
would be interesting.
@ekohl Indeed the regexs on version, release , ... absolutely needed a
|
|
Just to help me understand: what's the reason for this? |
It was just an observation. I presume it's to avoid allowing a multiline string ? |
updated.
That makes sense to me. RPM's do not support arch of
I think they were lifted from the previous versionlock type. Above link is a guideline rather than enforced. If I try and make the RPM with a crazy name.
I do indeed get an RPM
:-) The |
agreed. |
l> line with assert_type(Yum::RpmVersion is redundant, this is already done by argument type validation
It is needed afterall. The argument type allows undef for a yum based machine but on a @vchepkov I believe I have addressed your comments. |
IMHO, you don't need it, but it's not important, it's just a matter of preference.
|
I was talking about
|
|
epoch is now just an |
Have squashed commits , will merge Monday if no more comment. |
Motivated by the change of format to the versionlock file with DNF systems change `yum::versionlock` so it supports parameters `version`, `release`, `epoch` and `arch`. If version is specified the namevar is now the package name. So on a DNF based systemd (e.g CentOS 8) the following must be used. ```puppet yum::versionlock{'bash': version => '3.4', } ``` results in a version lock of on a dnf based system ``` bash-0:3.4-* ``` and on a yum based system of ``` 0:bash-3.4-* ``` A fuller example with all parameters set. ```puppet yum::versionlock{'bash': version => '5.4', release => 'alpha-rc3', epoch => 8, arch => 'noarch' } ``` results in a version lock on a DNF based system of ``` bash-8:5.4-alpha-rc3.noarch ``` The same mechanism on YUM based systems (e.g CentOS 7) can be used. To specify this new machanism at least a `version` should be set. ```puppet yum::versionlock{'bash': version => '5.4', release => 'alpha-rc3', epoch => 8, arch => 'noarch' future => true, } ``` would results in ``` 8:bash-5.4-alpha-rc3.noarch ``` as used by yum. If `version` is left default `undef` then the old mechanism is used so this is backwards compatable. e.g ```puppet yum::versionlock{"0:bash-3.4-7.el8.x86_64"} ``` is still valid Fixes: 150
Use the new versionlock specification from voxpupuli#169 on CentOS 8. Also test the new specification on 7 and 8 also. Finally test that if samba-devel is filtered at an impossible version it is no longer available. This for the yum case probably assumes that samba-devel is not actually installed.
Correct acceptence tests for DNF (8) system Use the new versionlock specification from voxpupuli#169 on CentOS 8. Also test the new specification on 7 and 8 also. Finally test that if samba-devel is filtered at an impossible version it is no longer available. This for the yum case probably assumes that samba-devel is not
Pull Request (PR) description
Support paramatized yum::versionlock
Motivated by the change of format to the versionlock file with DNF systems
change
yum::versionlock
so it supports parametersversion
,release
,epoch
andarch
. If version is specified the namevar is now the package name.So on a DNF based systemd (e.g CentOS 8) the following must be used.
results in a version lock of on a dnf based system
and on a yum based system of
A fuller example with all parameters set.
results in a version lock on a DNF based system of
The same mechanism on YUM based systems (e.g CentOS 7) can be used.
To specify this new machanism at least a
version
should be set.would results in
as used by yum. If
version
is left defaultundef
then the old mechanism is used so thisis backwards compatable. e.g
yum::versionlock{"0:bash-3.4-7.el8.x86_64"}
is still valid
This Pull Request (PR) fixes the following issues
Fixes #150