Bug 1388134

Summary: --upgrade-puppet option will re-run installer even if system is already on puppet 4
Product: Red Hat Satellite Reporter: Chris Duryee <cduryee>
Component: InstallationAssignee: Eric Helms <ehelms>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: high Docs Contact:
Priority: high    
Version: 6.3.0CC: bbuckingham, ehelms, lpramuk, stbenjam
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-3.4.5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:51:07 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 Chris Duryee 2016-10-24 14:45:15 UTC
Description of problem:


If a katello system is already running puppet 4, the --upgrade-puppet script should bail out with an error message instead of shutting down services and re-running the installer.

to repro:

    run foreman-installer --upgrade-puppet
    run foreman-installer --upgrade-puppet again

The second command should not restart services or perform any other upgrade steps.

Comment 4 Satellite Program 2017-07-11 14:10:22 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17073 has been resolved.

Comment 5 Satellite Program 2017-08-03 22:12:02 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17073 has been resolved.

Comment 6 Lukas Pramuk 2017-08-08 18:49:58 UTC
VERIFIED.

@satellite-6.3.0-16.0.beta.el7sat.noarch
puppet-agent-1.8.2-2.el7sat.x86_64
puppetserver-2.7.2-2.el7sat.noarch
katello-installer-base-3.4.4-1.el7sat.noarch

by following manual reproducer

1. Install Satellite using Puppet3
# satellite-installer -S satellite

2. Upgrade to Puppet4
# satellite-installer --upgrade-puppet
Upgrading puppet...
...
Puppet upgrade completed!

3. Try to run puppet upgrade again
# satellite-installer --upgrade-puppet
Puppet already installed and upgraded. Skipping.

>>> if satellite is already running puppet4 then puppet upgrade is being skipped immediately

Comment 7 Lukas Pramuk 2017-08-08 19:37:04 UTC
FailedQA.

Unfortunately on non-upgraded Puppet4 Satellite puppet upgrade is not skipped.

The fix just brought that --upgrade-puppet cannot be run twice, but that's not really what we want.

We want if puppet4 is already present then it cannot be run, so it's for the first time on non-upgraded p4 install.

Comment 8 Lukas Pramuk 2017-08-08 19:48:18 UTC
Puppet4 installation shall create "/etc/foreman-installer/.puppet_4_upgrade" file to fix it for non-upgraded p4 install.

Comment 9 Eric Helms 2017-08-09 02:03:23 UTC
I am not sure we can safely detect the difference between a fresh install and an upgraded Puppet 4 that failed half way through. I like the spirit of your request, I just don't know how we pull this off safely.

Comment 10 Lukas Pramuk 2017-08-10 18:57:40 UTC
Eric,

The trouble is that the check is based on existence of some file, so --upgrade-puppet won't be simply run twice. But this fails for clean p4 installation.

Why the check is not about what puppet version is present? That would cover both, clean p4 and upgraded p4 installation.

"Is puppet_version < 4 ? then go for upgrade else skip"

Comment 11 Lukas Pramuk 2017-09-04 15:27:30 UTC
VERIFIED.

@satellite-6.3.0-17.0.beta.el7sat.noarch
katello-installer-base-3.4.5-1.el7sat.noarch
puppet-agent-1.8.2-2.el7sat.x86_64
puppetserver-2.7.2-2.el7sat.noarch

using manual reproducer described in comment#6:

3.  Try to run puppet upgrade again (upgraded install) or needlessly (fresh p4 install) 

@upgraded p4 install:
# satellite-installer --upgrade-puppet
Puppet already installed and upgraded. Skipping.

@clean p4 install:
# satellite-installer --upgrade-puppet
Puppet already installed and upgraded. Skipping.

>>> if system is already on puppet4 then the installer refuses to run puppet upgrade needlessly (possibly breaking things)

Comment 12 Satellite Program 2018-02-21 16:51:07 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/RHSA-2018:0336