Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1649329 - [RFE] foreman-maintain should be self-updating
Summary: [RFE] foreman-maintain should be self-updating
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Satellite Maintain
Version: 6.3.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 6.8.0
Assignee: Amit Upadhye
QA Contact: Jameer Pathan
URL:
Whiteboard:
: 1674937 (view as bug list)
Depends On:
Blocks: 1827137
TreeView+ depends on / blocked
 
Reported: 2018-11-13 12:05 UTC by Rich Jerrido
Modified: 2022-03-13 16:03 UTC (History)
13 users (show)

Fixed In Version: rubygem-foreman_maintain-0.6.4
Doc Type: Enhancement
Doc Text:
The `satellite-maintain` package now upgrades itself automatically when you enter `satellite-maintain upgrade check` or `satellite-maintain upgrade run` commands. Optionally, you can use the `--disable-self-upgrade` option to skip the auto-update of the `satellite-maintain` package.
Clone Of:
Environment:
Last Closed: 2020-10-27 12:38:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 28649 0 Normal Closed Auto upgrade foreman-maintain if new package is available 2021-02-02 15:36:04 UTC
Red Hat Product Errata RHBA-2020:4365 0 None None None 2020-10-27 12:38:41 UTC

Description Rich Jerrido 2018-11-13 12:05:58 UTC
As foreman-maintain contains a lot of the upgrade logic required to upgrade from one version to another, it would be useful if the tool attempts to check to see if it is the latest version other than running. 

Otherwise, you run into scenarios where the user isn't using the latest, and doesnt see that they can upgrade to the latest .Y or .Z release. 

We can do either of: 

- check to see if there is a newer version of f-m. If yes, update to the latest and reinvoke the utility

- check to see if there is a newer version of f-m. If yes, inform the user to update and reinvoke

Comment 1 Anurag Patel 2018-11-13 12:41:57 UTC
Hello Rich,

A couple of questions with respect to auto-updating foreman-maintain.

1. Since foreman-maintain ships in a separate repository that's not tied to a satellite release, if the user periodically does yum update, she should always be on latest foreman-maintain right?

2. What would be the source for determining a newer version of foreman-maintain? External API would be out of scope. Would `yum check-update rubygem-foreman_maintain` be reasonable?

Anurag

Comment 2 Mike McCune 2018-11-13 15:08:35 UTC
1) yes, but most customers don't randomly or periodically 'yum update'. They often only do it during Satellite upgrades so this often gets missed.

2) `yum check-update rubygem-foreman_maintain` should be fine, I'd definitely rely on yum.

will be interesting to see if you can get a process to spawn yum to update itself, but if that proves difficult we can at least error out and say to the user:

'there is a new version of rubygem-foreman_maintain, please yum update this package to ensure you have the latest version'

or something to that effect.

Also note: There may be cases and times users don't want to auto-update (bugs or compatibility issues that we didn't handle) so we need an option to skip or whitelist.

Comment 3 Rich Jerrido 2018-11-14 00:18:57 UTC
+1 to what Mike said.

Comment 4 Bryan Kearney 2019-02-14 18:10:43 UTC
*** Bug 1674937 has been marked as a duplicate of this bug. ***

Comment 8 Bryan Kearney 2020-04-07 16:02:46 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/28649 has been resolved.

Comment 10 Jameer Pathan 2020-06-19 08:27:12 UTC
# foreman-maintain upgrade check --target-version 6.8.z
Checking for new version of satellite-maintain...

rubygem-foreman_maintain.noarch                    1:0.6.5-1.el7sat                    Sat6-CI_Red_Hat_Satellite_6_8_Composes_Satellite_Maintenance_Next_RHEL7

Updating satellite-maintain package.

The satellite-maintain package successfully updated.
Re-run satellite-maintain with required options!

Comment 11 Jameer Pathan 2020-06-19 08:40:00 UTC
Verified:
- Satellite 6.8.0 snap 4
- rubygem-foreman_maintain-0.6.4-1.el7sat.noarch.rpm

Observations:
- Whenever user will run foreman-maintain upgrade command with run/check option, it'll check
if there is any update available and if so then it will auto-update foreman-maintain and will ask user to 
re-run the command.
- Users can skip auto-update of foreman-maintain package using --disable-self-upgrade option.

Comment 16 errata-xmlrpc 2020-10-27 12:38:20 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 (Satellite 6.8 Satellite Maintenance Release), 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-2020:4365


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