Bug 1255012

Summary: subscription-manager-registration snippet not compatible with older kickstart repos
Product: Red Hat Satellite Reporter: Fred van Zwieten <fvzwieten>
Component: ProvisioningAssignee: Stephen Benjamin <stbenjam>
Status: CLOSED ERRATA QA Contact: Kedar Bidarkar <kbidarka>
Severity: high Docs Contact:
Priority: high    
Version: 6.1.0CC: bbuckingham, bkearney, cwelton, kbidarka, ktordeur, ldelouw, mjahangi, mmccune, nshaik, stbenjam, sthirugn, suprabhu
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 08:54:41 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:

Description Fred van Zwieten 2015-08-19 12:37:14 UTC
Description of problem:
The subscription-manager-registration snippet that ships with sat6.* contans the following code:

subscription-manager repos --enable=rhel-*-satellite-tools-*-rpms

This does not work with subscription-manager versions that are part of older kickstart repos (i checked 5.9 and 6.4). Those versions do not support wildcards in repo names.

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


How reproducible:
Try to deploy a RHEL 5.9 or 6.4 machine with satellite 6.1 IT will fail at this command.

Steps to Reproduce:
1.
2.
3.

Actual results:
Provisioned host with a partially executed kickstart post

Expected results:
Fully provisioned host

Additional info:

Comment 2 DipenDevra 2015-08-26 02:04:02 UTC
Hello,

In addition to the above description, On RHEL 6.4, subscription-manager package version is:-  subscription-manager-1.1.23-1.el6.x86_64.rpm

The above version of package does not have functionality to use wildcard to enable/disable repos even when try to do by running command.

----
# subscription-manager repos --disable=rhel-*-rpms
Error: rhel-*-rpms is not a valid repo id. Use --list option to see valid repos.
----

It seems it is required to include the updated version of `subscription-manager` package in RHEL 6.4 kickstart trees.

Or might be we may have a different `subscription-manager` snippet for RHEL 6.4 or earlier RHEL versions.

In one of my case Customer have modified the `subscription-manager` snippet in following way to enable the repos and complete registration process during provisioning through satellite 6:-

replaced the default:

------
<% if @host.operatingsystem.name == "RedHat" %>
# add the rhel rpms to install katello agent
subscription-manager repos --enable=rhel-*-satellite-tools-*-rpms
<% end %>
-------

with:

--------
<% if @host.operatingsystem.name == "RedHat" %>
# add the rhel rpms to install katello agent
subscription-manager repos --enable=rhel-<%= @host.operatingsystem.major -%>-server-satellite-tools-6.1-rpms
<% end %>
-----

This sees to work for Customer.

Best Regards,
Dipen Devra

Comment 3 Fred van Zwieten 2015-08-26 06:34:49 UTC
Yep, I made this change for them. As far as I know the full version of satellite (6.1 in this example) can not be templated, or can it?

Comment 5 Stephen Benjamin 2016-03-10 18:32:29 UTC
In Satellite 6.2, we've removed this line entirely as we expect users to configure an activation key that enables the repo.  The error message is now gone.

Activation key repo overrides work with RHEL 6.5 and 5.10 or newer. 6.4 and 5.9 are out of EUS suport, so they won't be receiving any updates to subscription-manager.  They can still register as Satellite clients, but to enable non-default repos, tools and any others will have to be done manually after provisioning, or as part of your own custom template.


Validation:
  QE should just validate the error message in comment #1 no longer appears on older clients.

Comment 7 Tazim Kolhar 2016-04-07 07:25:22 UTC
Hi,

   please, provide verification steps
 

thanks and regards,
Tazim

Comment 8 Stephen Benjamin 2016-04-07 12:05:47 UTC
The end of comment #5 has the verification step.  You won't see "Error: rhel-*-rpms is not a valid repo id. Use --list option to see valid repos." in the kickstart post log after provisioing an old version of RHEL (e.g. 6.4)

Comment 12 Tazim Kolhar 2016-04-13 11:27:14 UTC
VERIFIED:
# rpm -qa foreman
foreman-1.11.0.11-1.el7sat.noarch



Steps:
1.)Create a product rhel64_prod
2.)Create a repo rhel64
    - KS repos from manifest 
3.) Sync the repo
4.) Create domain and subnet
5.) Create a libvirt compute resource
6.) Create a host group
7.) Make sure operating is associated with partition-table, installation media
    and templates
8.) Provision a host with rhel64 repos

$ cat install.post.log 
updating system time
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Nothing to do
Retrieving http://intel-waimeabay-hedt-01.ml3.eng.bos.redhat.com/pub/katello-ca-consumer-latest.noarch.rpm
Preparing...                ##################################################
katello-ca-consumer-intel-wa##################################################
Registering the System
The system has been registered with id: 6418d88b-d578-47aa-bdde-720df8ee3562 
Installing Katello Agent
Loaded plugins: product-id, security, subscription-manager
This system is receiving updates from Red Hat Subscription Management.
Setting up Install Process
No package katello-agent available.
Error: Nothing to do
error reading information on service goferd: No such file or directory
Loaded plugins: product-id, security, subscription-manager
This system is receiving updates from Red Hat Subscription Management.
Setting up Update Process
No Packages marked for Update
Informing Foreman that we are built

Comment 14 Kedar Bidarkar 2016-05-24 12:36:20 UTC
This bug needs to be re-verified, will test this probably with sat6.2 Beta stuff as we do not need custom repos here.

Comment 15 Kedar Bidarkar 2016-05-24 12:53:49 UTC
Will move this to VERIFIED state and track everything in over this bug,

https://bugzilla.redhat.com/show_bug.cgi?id=1331432

Comment 17 Selim Jahangir 2016-07-14 00:45:30 UTC
Case#01667045

Satellite 6.1

RHEL6.8
Subscription-manager rpm is "subscription-manager-1.16.8-8.el6.s390x"

Error message while kickstarting using satellite 6.1:

"Error: rhel-*-satellite-tools-*-rpms is not a valid repository ID. Use --list option to see valid repositories."

Comment 19 errata-xmlrpc 2016-07-27 08:54:41 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-2016:1500