Bug 1558411

Summary: [RFE] provide subscription-manager plugin for YUM4 (DNF) on RHEL7
Product: Red Hat Enterprise Linux 7 Reporter: Daniel Mach <dmach>
Component: subscription-managerAssignee: Chris Snyder <csnyder>
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: unspecified Docs Contact: Marie Hornickova <mdolezel>
Priority: high    
Version: 7.6CC: candlepin-bugs, csnyder, jsefler, khowell, mdomonko, redakkan, rjerrido, vmukhame
Target Milestone: rcKeywords: EasyFix, FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Release Note
Doc Text:
Story Points: ---
Clone Of:
: 1593192 (view as bug list) Environment:
Last Closed: 2018-10-30 11:54:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1613454, 1613456    
Bug Blocks: 1461652, 1544891, 1593192    

Description Daniel Mach 2018-03-20 07:53:41 UTC
This is a request to provide subscription-manager YUM4 (DNF) plugin as part of subscription-manager sources in RHEL 7.

The YUM4 software management stack (based on DNF) needs to be able to consume content from CDN. Subscription-manager plugins for YUM4 are not available on RHEL 7 at the moment.

This is related to bz#1533905, but for a different distro.

YUM4 will be most likely shipped in an additional (opt-in) repo rather than part of core RHEL. That's why the python2-dnf-plugin-* sub-packages must NOT land in RHEL 7 repos directly. We could either ship the sub-packages in the additional repo or re-build RHSM from (identical) source with different macros to enable the plugin and then ship it in the additional repo.

Comment 12 Rehana 2018-08-31 09:29:18 UTC
Verifying on :
------------

# rpm -qa subsc* dnf* | sort
dnf-2.7.5-17.el7.noarch
dnf-data-2.7.5-17.el7.noarch
dnf-plugin-subscription-manager-1.21.7-1.el7.x86_64
subscription-manager-1.21.7-1.el7.x86_64
subscription-manager-cockpit-1.21.7-1.el7.noarch
subscription-manager-gui-1.21.7-1.el7.x86_64
subscription-manager-initial-setup-addon-1.21.7-1.el7.x86_64
subscription-manager-plugin-container-1.21.7-1.el7.x86_64
subscription-manager-rhsm-1.21.7-1.el7.x86_64
subscription-manager-rhsm-certificates-1.21.7-1.el7.x86_64

Note:Install dnf-plugin-subscription manager and its dependencies from Extras repo.

Since both yum and dnf can co-exist on RHEL76, make sure to disable all yum plugins in order to ensure that system is using dnf and its plugins ..

1.Make sure all the yum plugin are disabled on the system 

# subscription-manager config --list | grep auto_enable
   auto_enable_yum_plugins = 0
2.
# cat /etc/yum/pluginconf.d/search-disabled-repos.conf | grep enabled
enabled=0
# Repositories matching the patterns listed in ignored_repos will not be enabled by the plugin

# cat /etc/yum/pluginconf.d/subscription-manager.conf | grep enabled
enabled=0

# cat /etc/yum/pluginconf.d/product-id.conf | grep enabled
enabled=0

3. Register and auto-attach system 

# subscription-manager register --auto-attach
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: stage_test_rhel74
Password: 
The system has been registered with ID: 2ef60f9e-a2d0-4504-9881-78ac49cc0491
The registered system name is: dhcp35-137.lab.eng.blr.redhat.com
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux 7 Server High Touch Beta
Status:       Subscribed

4.Remove the redhat.repo file from the system 

# rm -rf /etc/yum.repos.d/redhat.repo

5.Verify the repolist and make sure the subscription manager plugins (product-id and subscription-manager) are loaded 

# dnf repolist -d3
Loaded plugins: builddep, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, needs-restarting, playground, product-id, repoclosure, repograph, repomanage, reposync, subscription-manager
Updating Subscription Management repositories.
DNF version: 2.7.5
cachedir: /var/cache/dnf
Updating Subscription Management repositories.
Red Hat Enterprise Linux 7 Server HTB (RPMs)                                                                                                                                       1.2 MB/s | 7.9 MB     00:06    
Last metadata expiration check: 0:00:02 ago on Friday 31 August 2018 02:48:05 PM IST.
repo id                                                                                    repo name                                                                                                         status
rhel-7-server-htb-rpms                                                                     Red Hat Enterprise Linux 7 Server HTB (RPMs)                                                                      5,671

Notice that product-id and subscription-manager plugins are loaded , and user can successfully list the repos 

6. dnf install package from the repo

# dnf install zsh -d3
Loaded plugins: builddep, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, needs-restarting, playground, product-id, repoclosure, repograph, repomanage, reposync, subscription-manager
Updating Subscription Management repositories.
DNF version: 2.7.5
cachedir: /var/cache/dnf
Unknown configuration option: ui_repoid_vars = basearch in /etc/yum.repos.d/redhat.repo
Unknown configuration option: ui_repoid_vars = basearch in /etc/yum.repos.d/redhat.repo
Unknown configuration option: ui_repoid_vars = basearch in /etc/yum.repos.d/redhat.repo
Unknown configuration option: ui_repoid_vars = basearch in /etc/yum.repos.d/redhat.repo
Unknown configuration option: ui_repoid_vars = basearch in /etc/yum.repos.d/redhat.repo
Unknown configuration option: ui_repoid_vars = basearch in /etc/yum.repos.d/redhat.repo
Updating Subscription Management repositories.
Red Hat Enterprise Linux 7 Server HTB (RPMs)                                                                                                                                       2.7 MB/s | 7.9 MB     00:02    
not found deltainfo for: Red Hat Enterprise Linux 7 Server HTB (RPMs)
rhel-7-server-htb-rpms: using metadata from Wednesday 29 August 2018 08:49:17 PM IST.
Last metadata expiration check: 0:00:02 ago on Friday 31 August 2018 02:51:01 PM IST.
Missing file *modules.yaml in metadata cache dir: /var/cache/dnf/rhel-7-server-htb-rpms-41c05b048b64168e
Completion plugin: Generating completion cache...
--> Starting dependency resolution
---> Package zsh.x86_64 5.0.2-31.el7 will be installed
--> Finished dependency resolution
Dependencies resolved.
===================================================================================================================================================================================================================
 Package                                    Arch                                          Version                                              Repository                                                     Size
===================================================================================================================================================================================================================
Installing:
 zsh                                        x86_64                                        5.0.2-31.el7                                         rhel-7-server-htb-rpms                                        2.4 M

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package

Total download size: 2.4 M
Installed size: 5.6 M
Is this ok [y/N]: y
Downloading Packages:
zsh-5.0.2-31.el7.x86_64.rpm                                                                                                                                                        1.2 MB/s | 2.4 MB     00:02    
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                              1.2 MB/s | 2.4 MB     00:02     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                           1/1 
  Installing       : zsh-5.0.2-31.el7.x86_64                                                                                                                                                                   1/1 
  Running scriptlet: zsh-5.0.2-31.el7.x86_64                                                                                                                                                                   1/1 
  Verifying        : zsh-5.0.2-31.el7.x86_64                                                                                                                                                                   1/1 
Completion plugin: Generating completion cache...
Installed products updated.

Installed:
  zsh.x86_64 5.0.2-31.el7                                                                                                                                                                                          

Complete!

User could successfully install a package on system using dnf command. 

Note: A separate bug is logged to track the "Unknown configuration option: ui_repoid_vars = basearch in /etc/yum.repos.d/redhat.repo" Bug 1614649

Conclusion:
Based on the above observation, confirmed that user can now list repos and install packages from repos using dnf command. Moving this bug to verified.

Comment 20 errata-xmlrpc 2018-10-30 11:54:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:3367