Bug 1329349 - [RFE] Add a subscription-manager plugin to yum-config-manager
Summary: [RFE] Add a subscription-manager plugin to yum-config-manager
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager   
(Show other bugs)
Version: 7.2
Hardware: Unspecified Unspecified
high
medium
Target Milestone: rc
: ---
Assignee: Kevin Howell
QA Contact: John Sefler
Filip Hanzelka
URL:
Whiteboard:
Keywords: Extras, FutureFeature, Triaged, ZStream
Depends On:
Blocks: 1186913 1420851 1469152 1486326
TreeView+ depends on / blocked
 
Reported: 2016-04-21 17:08 UTC by Jake Hunsaker
Modified: 2018-04-10 09:48 UTC (History)
15 users (show)

Fixed In Version: subscription-manager-1.20.2-1
Doc Type: Release Note
Doc Text:
A *subscription-manager* plugin now runs with *yum-config-manager* With this update, the *subscription-manager* plugin runs with the *yum-config-manager* utility. The *yum-config-manager* operations now trigger `redhat.repo` generation, allowing Red Hat Enterprise Linux containers to enable or disable repositories without first running "yum" commands.
Story Points: ---
Clone Of:
: 1486326 (view as bug list)
Environment:
Last Closed: 2018-04-10 09:47:31 UTC
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Github candlepin subscription-manager pull 1663 None None None 2017-07-06 19:25 UTC
Red Hat Product Errata RHBA-2018:0681 None None None 2018-04-10 09:48 UTC

Description Jake Hunsaker 2016-04-21 17:08:02 UTC
I am not sure if this is the right component for this bug, however I'm starting it in docker since the daemon is what injects the subscription information into the container. 

Description of problem:

The rhel-7-server-thirdparty-oracle-java-rpms is not able to be seen inside a container when all other RHEL repos are visible.

Version-Release number of selected component (if applicable):
docker-1.9.1

How reproducible:
Easily

Steps to Reproduce:
1. Subscribe a RHEL/AH to a subscription with access to the oraclejava repo
2. Attempt to enable the repo inside the container with yum-config-manager
3.

Actual results:

[root@39a297ba15c2 /]# yum-config-manager --enablerepo=rhel-7-server-thirdparty-oracle-java-rpms
Loaded plugins: ovl, product-id
Error getting repository data for rhel-7-server-thirdparty-oracle-java-rpms, repository not found


Expected results:

Repo should be visible inside the container as it is visible to the host. 

Additional info:

Host has no issues enabling the repo which I know is not really indicative of anything for the container, but figured I'd mention it.

A workaround exists by volume-mounting the hosts' redhat.repo file (with oraclejava enabled) as well as /etc/pki/entitlement. With both of these volume mounts the container can access the repo, but this shouldn't be required.

It appears this is only the case for the oraclejava repo and customer reports they can properly enable any other RH repo the host can see.

Comment 2 Daniel Walsh 2016-04-22 19:08:14 UTC
I think this is a subscription manager problem.

Comment 6 John Sefler 2016-04-26 12:26:00 UTC
Here is a white paper solution for this issue...

How are repositories enabled inside a docker container and use Red Hat subscriptions or entitlements to access repositories?

https://access.redhat.com/solutions/1443553

Comment 10 Kevin Howell 2017-07-06 19:26:57 UTC
The attached PR addresses the observation from comment 7. This should improve the user experience (though the use case still requires using yum-config-manager to enable/disable repos as a first step)...

Comment 11 Alex Wood 2017-08-18 17:51:49 UTC
*** Bug 1480659 has been marked as a duplicate of this bug. ***

Comment 20 Shwetha Kallesh 2017-11-14 05:42:16 UTC
reproducer:

[root@foo ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.0.43-1
subscription management rules: 5.26
subscription-manager: 1.19.23-1.el7_4
python-rhsm: 1.19.10-1.el7_4

[root@foo ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux AS, Standard
Provides:            Red Hat Beta
                     Red Hat Hardware Certification Test Suite
                     Red Hat Software Collections Beta (for RHEL Server)
                     Oracle Java (for RHEL Server)
                     Red Hat Enterprise Linux Server
                     Red Hat Enterprise Linux Resilient Storage (for RHEL Server)
                     Red Hat Enterprise Linux High Availability (for RHEL Server)
                     Red Hat Enterprise Linux Load Balancer (for RHEL Server)
SKU:                 MCT0335
Contract:            11486102
Account:             6114661
Serial:              6028877992045906494
Pool ID:             8a99f9875ea4b859015ea4c4c5430129
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Standard
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              09/21/2017
Ends:                09/20/2018
System Type:         Physical

[root@foo ~]# service docker restart
Redirecting to /bin/systemctl restart docker.service
[root@foo ~]# docker pull rhel7
Using default tag: latest
Trying to pull repository registry.access.redhat.com/rhel7 ... 
latest: Pulling from registry.access.redhat.com/rhel7
243dc7b9e786: Pull complete 
550516fb1c76: Pull complete 
Digest: sha256:a744ef5b58472bccfa7c606efcc6b126a164eee4b7057f85cb8be46c481ee954

[root@foo ~]# subscription-manager repos --list-disabled | grep rhel-7-server-thirdparty-oracle-java-rpms -A4
Repo ID:   rhel-7-server-thirdparty-oracle-java-rpms
Repo Name: Red Hat Enterprise Linux 7 Server - Oracle Java (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/$basearch/oracle-java/os
Enabled:   0

[root@foo ~]# docker run -t -i --rm registry.access.redhat.com/rhel7 /bin/bash
[root@c7cd62478d93 /]# yum-config-manager --enablerepo=rhel-7-server-thirdparty-oracle-java-rpmsyum-config-manager --enablerepo=rhel-7-server-thirdparty-oracle-java-rpms
Loaded plugins: ovl, product-id, subscription-manager
Error getting repository data for rhel-7-server-thirdparty-oracle-java-rpmsyum-config-manager, repository not found

Comment 21 Shwetha Kallesh 2017-11-14 07:37:54 UTC
Verification:

[root@hp-ms-01-c06 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.0.43-1
subscription management rules: 5.26
subscription-manager: 1.20.5-1.el7


[root@hp-ms-01-c06 ~]# service docker restart
Redirecting to /bin/systemctl restart docker.service
[root@hp-ms-01-c06 ~]# docker pull rhel7
Using default tag: latest
Trying to pull repository registry.access.redhat.com/rhel7 ... 
latest: Pulling from registry.access.redhat.com/rhel7
243dc7b9e786: Pull complete 
550516fb1c76: Pull complete 
Digest: sha256:a744ef5b58472bccfa7c606efcc6b126a164eee4b7057f85cb8be46c481ee954
[root@hp-ms-01-c06 ~]# subscription-manager  list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux AS, Standard
Provides:            Red Hat Beta
                     Red Hat Hardware Certification Test Suite
                     Red Hat Software Collections Beta (for RHEL Server)
                     Oracle Java (for RHEL Server)
                     Red Hat Enterprise Linux Server
                     Red Hat Enterprise Linux Resilient Storage (for RHEL Server)
                     Red Hat Enterprise Linux High Availability (for RHEL Server)
                     Red Hat Enterprise Linux Load Balancer (for RHEL Server)
SKU:                 MCT0335
Contract:            11486102
Account:             6114661
Serial:              7412909181845479831
Pool ID:             8a99f9875ea4b859015ea4c4c5430129
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Standard
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              09/21/2017
Ends:                09/20/2018
System Type:         Physical

[root@hp-ms-01-c06 ~]# subscription-manager repos --list-disabled | grep rhel-7-server-thirdparty-oracle-java-rpms -A4
Repo ID:   rhel-7-server-thirdparty-oracle-java-rpms
Repo Name: Red Hat Enterprise Linux 7 Server - Oracle Java (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/$basearch/oracle-java/os
Enabled:   0

[root@hp-ms-01-c06 ~]# docker run -t -i --rm registry.access.redhat.com/rhel7
[root@b663be1cd52b /]#  yum-config-manager --enablerepo=rhel-7-server-thirdparty-oracle-java-rpms
Loaded plugins: ovl, product-id, subscription-manager
================================================================================= main =================================================================================
[main]
alwaysprompt = True
assumeno = False
assumeyes = False
autocheck_running_kernel = True
autosavets = True
bandwidth = 0
bugtracker_url = https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&version=rawhide&component=yum
cache = 0
cachedir = /var/cache/yum/x86_64/7Server
check_config_file_age = True
clean_requirements_on_remove = False
color = auto
color_list_available_downgrade = dim,cyan
color_list_available_install = normal
color_list_available_reinstall = bold,underline,green
color_list_available_running_kernel = bold,underline
color_list_available_upgrade = bold,blue
color_list_installed_extra = bold,red
color_list_installed_newer = bold,yellow
color_list_installed_older = bold
color_list_installed_reinstall = normal
color_list_installed_running_kernel = bold,underline
color_search_match = bold
color_update_installed = normal
color_update_local = bold
color_update_remote = normal
commands = 
debuglevel = 2
deltarpm = 2
deltarpm_metadata_percentage = 100
deltarpm_percentage = 75
depsolve_loop_limit = 100
disable_includes = 
diskspacecheck = True
distroverpkg = system-release(releasever),
   redhat-release
downloaddir = 
downloadonly = 
enable_group_conditionals = True
enabled = True
enablegroups = True
errorlevel = 2
exactarch = True
exactarchlist = 
exclude = 
exit_on_lock = False
failovermethod = priority
fssnap_abort_on_errors = any
fssnap_automatic_keep = 1
fssnap_automatic_post = False
fssnap_automatic_pre = False
fssnap_devices = !*/swap,
   !*/lv_swap
fssnap_percentage = 100
ftp_disable_epsv = False
gaftonmode = False
gpgcheck = True
group_command = objects
group_package_types = mandatory,
   default
groupremove_leaf_only = False
history_list_view = single-user-commands
history_record = True
history_record_packages = yum,
   rpm
http_caching = all
installonly_limit = 3
installonlypkgs = kernel,
   kernel-bigmem,
   installonlypkg(kernel-module),
   installonlypkg(vm),
   kernel-enterprise,
   kernel-smp,
   kernel-debug,
   kernel-unsupported,
   kernel-source,
   kernel-devel,
   kernel-PAE,
   kernel-PAE-debug
installroot = /
ip_resolve = 
keepalive = True
keepcache = False
kernelpkgnames = kernel,
   kernel-smp,
   kernel-enterprise,
   kernel-bigmem,
   kernel-BOOT,
   kernel-PAE,
   kernel-PAE-debug
loadts_ignoremissing = False
loadts_ignorenewrpm = False
loadts_ignorerpm = False
localpkg_gpgcheck = False
logfile = /var/log/yum.log
max_connections = 0
mddownloadpolicy = sqlite
mdpolicy = group:small
metadata_expire = 21600
metadata_expire_filter = read-only:present
minrate = 0
mirrorlist_expire = 86400
multilib_policy = best
obsoletes = True
override_install_langs = en_US
overwrite_groups = False
password = 
payload_gpgcheck = False
persistdir = /var/lib/yum
pluginconfpath = /etc/yum/pluginconf.d
pluginpath = /usr/share/yum-plugins,
   /usr/lib/yum-plugins
plugins = True
progess_obj = 
protected_multilib = True
protected_packages = yum,
   systemd
proxy = False
proxy_password = 
proxy_username = 
query_install_excludes = False
recent = 7
recheck_installed_requires = True
remove_leaf_only = False
repo_gpgcheck = False
repopkgsremove_leaf_only = False
reposdir = /etc/yum/repos.d,
   /etc/yum.repos.d
reset_nice = True
retries = 10
rpm_check_debug = True
rpmverbosity = info
showdupesfromrepos = False
skip_broken = False
skip_missing_names_on_install = True
skip_missing_names_on_update = True
ssl_check_cert_permissions = True
sslcacert = 
sslclientcert = 
sslclientkey = 
sslverify = True
syslog_device = /dev/log
syslog_facility = LOG_USER
syslog_ident = 
throttle = 0
timeout = 30.0
tolerant = True
tsflags = nodocs
ui_repoid_vars = releasever,
   basearch
upgrade_group_objects_upgrade = True
upgrade_requirements_on_install = False
username = 
usr_w_check = True

======================================================================= repo: rhel-7-server-rpms =======================================================================
[rhel-7-server-rpms]
async = True
bandwidth = 0
base_persistdir = /var/lib/yum/repos/x86_64/7Server
baseurl = https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/os
cache = 0
cachedir = /var/cache/yum/x86_64/7Server/rhel-7-server-rpms
check_config_file_age = True
compare_providers_priority = 80
cost = 1000
deltarpm_metadata_percentage = 100
deltarpm_percentage = 
enabled = True
enablegroups = True
exclude = 
failovermethod = priority
ftp_disable_epsv = False
gpgcadir = /var/lib/yum/repos/x86_64/7Server/rhel-7-server-rpms/gpgcadir
gpgcakey = 
gpgcheck = True
gpgdir = /var/lib/yum/repos/x86_64/7Server/rhel-7-server-rpms/gpgdir
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
hdrdir = /var/cache/yum/x86_64/7Server/rhel-7-server-rpms/headers
http_caching = all
includepkgs = 
ip_resolve = 
keepalive = True
keepcache = False
mddownloadpolicy = sqlite
mdpolicy = group:small
mediaid = 
metadata_expire = 86400
metadata_expire_filter = read-only:present
metalink = 
minrate = 0
mirrorlist = 
mirrorlist_expire = 86400
name = Red Hat Enterprise Linux 7 Server (RPMs)
old_base_cache_dir = 
password = 
persistdir = /var/lib/yum/repos/x86_64/7Server/rhel-7-server-rpms
pkgdir = /var/cache/yum/x86_64/7Server/rhel-7-server-rpms/packages
proxy = False
proxy_dict = 
proxy_password = 
proxy_username = 
repo_gpgcheck = False
retries = 10
skip_if_unavailable = False
ssl_check_cert_permissions = True
sslcacert = /etc/rhsm-host/ca/redhat-uep.pem
sslclientcert = /etc/pki/entitlement-host/7412909181845479831.pem
sslclientkey = /etc/pki/entitlement-host/7412909181845479831-key.pem
sslverify = True
throttle = 0
timeout = 30.0
ui_id = rhel-7-server-rpms/7Server/x86_64
ui_repoid_vars = releasever,
   basearch
username = 

=========================================================== repo: rhel-7-server-thirdparty-oracle-java-rpms ============================================================
[rhel-7-server-thirdparty-oracle-java-rpms]
async = True
bandwidth = 0
base_persistdir = /var/lib/yum/repos/x86_64/7Server
baseurl = https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/oracle-java/os
cache = 0
cachedir = /var/cache/yum/x86_64/7Server/rhel-7-server-thirdparty-oracle-java-rpms
check_config_file_age = True
compare_providers_priority = 80
cost = 1000
deltarpm_metadata_percentage = 100
deltarpm_percentage = 
enabled = 1
enablegroups = True
exclude = 
failovermethod = priority
ftp_disable_epsv = False
gpgcadir = /var/lib/yum/repos/x86_64/7Server/rhel-7-server-thirdparty-oracle-java-rpms/gpgcadir
gpgcakey = 
gpgcheck = True
gpgdir = /var/lib/yum/repos/x86_64/7Server/rhel-7-server-thirdparty-oracle-java-rpms/gpgdir
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
hdrdir = /var/cache/yum/x86_64/7Server/rhel-7-server-thirdparty-oracle-java-rpms/headers
http_caching = all
includepkgs = 
ip_resolve = 
keepalive = True
keepcache = False
mddownloadpolicy = sqlite
mdpolicy = group:small
mediaid = 
metadata_expire = 86400
metadata_expire_filter = read-only:present
metalink = 
minrate = 0
mirrorlist = 
mirrorlist_expire = 86400
name = Red Hat Enterprise Linux 7 Server - Oracle Java (RPMs)
old_base_cache_dir = 
password = 
persistdir = /var/lib/yum/repos/x86_64/7Server/rhel-7-server-thirdparty-oracle-java-rpms
pkgdir = /var/cache/yum/x86_64/7Server/rhel-7-server-thirdparty-oracle-java-rpms/packages
proxy = False
proxy_dict = 
proxy_password = 
proxy_username = 
repo_gpgcheck = False
retries = 10
skip_if_unavailable = False
ssl_check_cert_permissions = True
sslcacert = /etc/rhsm-host/ca/redhat-uep.pem
sslclientcert = /etc/pki/entitlement-host/7412909181845479831.pem
sslclientkey = /etc/pki/entitlement-host/7412909181845479831-key.pem
sslverify = True
throttle = 0
timeout = 30.0
ui_id = rhel-7-server-thirdparty-oracle-java-rpms/7Server/x86_64
ui_repoid_vars = releasever,
   basearch
username =

Comment 27 errata-xmlrpc 2018-04-10 09:47:31 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/RHBA-2018:0681


Note You need to log in before you can comment on or make changes to this bug.