Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1363833

Summary: Need a way to upgrade to the latest satellite-tools repository
Product: Red Hat Satellite 6 Reporter: Mike McCune <mmccune>
Component: katello-agentAssignee: Mike McCune <mmccune>
Status: CLOSED ERRATA QA Contact: jcallaha
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1.9CC: bkurt, greartes, jcallaha, sthirugn, swadeley, xdmoon
Target Milestone: UnspecifiedKeywords: PrioBumpQA
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-22 06:50:09 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:
Attachments:
Description Flags
RHEL5
none
RHEL6
none
RHEL7 none

Description Mike McCune 2016-08-03 16:53:05 UTC
We had a problem we had with 6.0 -> 6.1 migrations when we moved from rh-common to sat-tools repos. With 6.1 to 6.2 we now have to have customers upgrade from the rhel-*-server-satellite-tools-6.1-rpms to rhel-*-server-satellite-tools-6.2-rpms but we do not offer any automation to accomplish this.

We have been discussion 3 main methods for automating this from Satellite:

 * Puppet: Have puppet interact with subscription-manager to update the enabled/disabled repos to point at 6.2
  - Downside: requires that the hosts be under Puppet management which a good portion of our customers are not

 * ReX: provide a ReX template to automate this
  - Downside: requires the deployment of ssh keys to all client systems. If you can mass deploy the ssh key, you can mass update subscription-manager settings.

 * Mass update the enabled repo via server-side or API logic, similar to the [Product Content] tab in the Content Host
  - Downside: Hosts will be unable to upgrade the bits in the 6.2 sat-tools repo until rhsmcertd does a checkin and the repo list is updated, could be hours after mass updating

I thought of another option over the weekend and wanted to get others thoughts on this:

 * Build a sat-tools-upgrade RPM that all it does is call a script in the %posttrans is to execute:

subscription-manager repos --disable rhel-*-server-satellite-tools-6.1-rpms
subscription-manager repos --enable rhel-*-server-satellite-tools-6.2-rpms

We would deliver this sat-tools-upgrade RPM in the 6.1 sat-tools repo vi an errata. Once this landed on the Satellite via a synchronization the users could then utilize the katello-agent infrastructure to mass install this package across all their hosts in their infrastructure:

https://mmccune.fedorapeople.org/scratch/sat-tools-mass-install.png

after running that the hosts can then be updated via the 'Update All Packages' or specifying a list in the Bulk Actions page to get them fully updated to the 6.2 set of tooling.

Comment 5 jcallaha 2016-08-17 16:01:10 UTC
The fix looks good on RHEL5, 6, and 7.

Steps:
1. Enable/Sync 6.1/6.2 tools repo for each rhel flavor.
2. Create custom product with a repo for each satellite-tools-upgrade package.
3. Create/Add a content view then add the tools and tools-upgrade content for each rhel version.
4. Publish.
5. Register each host, assign to appropriate CV.
6. Enable 6.1 tools repo, and install katello-agent.
7. Navigate to Content Hosts page and select all desired hosts.
8. Click Bulk Actions, then Packages tab.
9. Install "satellite-tools-upgrade"

Results:
The old 6.1 tools repo was disabled and the new 6.2 tools repo was disabled, as expected. See attached screenshots.

Comment 6 jcallaha 2016-08-17 16:01:32 UTC
Created attachment 1191669 [details]
RHEL5

Comment 7 jcallaha 2016-08-17 16:02:39 UTC
Created attachment 1191670 [details]
RHEL6

Comment 8 jcallaha 2016-08-17 16:02:56 UTC
Created attachment 1191671 [details]
RHEL7

Comment 9 jcallaha 2016-08-17 16:24:06 UTC
correction to Results in #5. "The old 6.1 tools repo was disabled and the new 6.2 tools repo were enabled, as expected."

Comment 11 errata-xmlrpc 2016-08-22 06:50:09 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-2016:1642