nodeps doesn't work
#33145 added the ability to specify nodeps when installing rpms which is documented here. Unfortunately this does not seem to work in 2017.7.2:
[[email protected] example]$ rpm -qa | egrep "^salt-"
salt-repo-latest-2.el7.noarch
salt-master-2017.7.2-1.el7.noarch
salt-api-2017.7.2-1.el7.noarch
salt-minion-2017.7.2-1.el7.noarch
salt-2017.7.2-1.el7.noarch
If I configure an example state:
example_install:
pkg.installed:
- sources:
- examle: salt://example/files/example-1.2.3-1.x86_64.rpm
- pkg_verify:
- verify_options: nodeps
example_install:
pkg.installed:
- sources:
- examle: salt://example/files/example-1.2.3-1.x86_64.rpm
- pkg_verify:
- verify_options:
- nodeps
This results in the error:
ID: example_install
Function: pkg.installed
Result: False
Comment: Error occurred installing package(s). Additional info follows:
errors:
- Running scope as unit run-67034.scope.
Loaded plugins: fastestmirror
Examining /var/cache/salt/minion/files/example/files/example-1.2.3-1.x86_64.rpm: example-1.2.3-1.x86_64
Marking /var/cache/salt/minion/files/example/files/example-1.2.3-1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package example.x86_64 0:1.2.3 will be installed
--> Processing Dependency: example2 >= 3.0.1 for package: example-1.2.3-1.x86_64
Loading mirror speeds from cached hostfile
--> Processing Dependency: libstdc++.so.5(CXXABI_1.2)(64bit) for package: example-1.2.3-1.x86_64
--> Processing Dependency: libstdc++.so.5()(64bit) for package: example-1.2.3-1.x86_64
--> Running transaction check
---> Package example.x86_64 0:1.2.3 will be installed
--> Processing Dependency: example2 >= 3.0.1 for package: example-1.2.3-1.x86_64
---> Package compat-libstdc++-33.x86_64 0:3.2.3-72.el7 will be installed
--> Finished Dependency Resolution
Error: Package: example-1.2.3-1.x86_64 (/example-1.2.3-1.x86_64)
Requires: example2 >= 3.0.1
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Started: 15:06:28.073208
Duration: 3328.353 ms
Changes:
Looks like I can replicate this with this state:
salt-cloud:
pkg.installed:
- pkg_verify:
- verify_options: ['nodeps','nofiledigest']
And in the log file it shows:
[INFO ] Executing command ['yum', '-y', 'install', 'salt-cloud'] in directory '/root' without the nodeps option passed to it
ping @lorengordon any chance you can take a look here?
That's because the verify_options feature doesn't apply to the yum install command. It applies to the verification command used afterwards to test if the requested packages were actually installed.
@lorengordon it appears to me that the example in the documentation would be using yum as well, correct? Is there a way to fallback to using rpm directly when verify_options is used - especially when a file source is used ( salt:// or http(s):// )?
Hmm, no, it doesn't appear to me that is what the documentation is implying. It is specifically an argument of the pkg_verify feature, and explicitly states that it is used by rpm -V when verifying the package. If you want to be able to pass nodeps or similar to the yum install command, I think that would be a new feature request.
The linked issue states "I envision this being executed via pkg.installed" and this is what the documentation has as well - copy/past from the documentation:
mypkgs:
pkg.installed:
- pkgs:
- foo
- bar: 1.2.3-4
- baz
- pkg_verify:
- ignore_types:
- config
- doc
- verify_options:
- nodeps
- nofiledigest
So, I think ultimately my disconnect is why the above example from the documentation 1) would work and 2) would not also be using yum.
Especially compared to the example I provided which is copied (and scrubbed) from my actual implementation - I would think specifying a specific source (instead of defaulting to the repo) would make my code more likely to use rpm directly (and honor the verify_options).
Well, I can only recommend tracing the source to figure it out. That's what I usually do when I find that something isn't working the way I think it should.
@Ch3LL I hope this all isn't coming across as rude, but I simply won't have time any time soon to fix something that doesn't really seem to me like a regression, and for a feature that I am not currently using. I'd rather not have anyone waiting on me to investigate further.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
bump
Thank you for updating this issue. It is no longer marked as stale.
apologies on getting to this issue late. Thanks @lorengordon ! and definitely does not come across as rude. Thanks for clearing up the misunderstanding, seems verify_options is meant to be used to verify packages, and not during the package install itself. So it seems this now needs to be moved to a feature request to add that nodeps option during the install.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.