Bug 1632101 - Satellite installer with option foreman-admin-password not working as expected.
Summary: Satellite installer with option foreman-admin-password not working as expected.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Installation
Version: 6.4
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: 6.6.0
Assignee: Chris Roberts
QA Contact: Devendra Singh
URL: https://projects.theforeman.org/issue...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-09-24 05:59 UTC by Sagar Lutade
Modified: 2019-10-22 20:23 UTC (History)
7 users (show)

Fixed In Version: foreman-installer-1.21.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-22 19:51:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 25170 0 None None None 2018-10-10 16:38:58 UTC

Description Sagar Lutade 2018-09-24 05:59:05 UTC
Description of problem:

When trying to set Satellite admin password using the satellite installer command the password is not getting updated.
Using the same old password.

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

>> Satellite 6.4 Beta.

How reproducible:
>> We can run the satellite-installer command along with the password option.

Steps to Reproduce:
>> On the Satellite terminal.

# satellite-installer -S satellite --foreman-admin-username admin --foreman-admin-password abc123

Actual results:

>> Installer completes successfully.

Expected results:

>> Foreman admin password must be updated.

Additional info:
NA

Comment 2 Marek Hulan 2018-09-26 12:22:44 UTC
Is this first run of the installer or consecutive run? Note that the installer does not add new admin account with new password if the admin accoun already exist after first installer run. That would be probably even less expected, imagine admin changes the password after installation, installer rerun would change it back to original one, e.g. during upgrade.

IMHO this is not a bug? Today the installer help says this

    --foreman-admin-password      Password of the initial admin user, default is randomly generated (current: "changeme")
    --foreman-admin-username      Username for the initial admin user (current: "admin")

Should we rephrase so that's clearer?

Comment 4 Marek Hulan 2018-10-11 06:54:19 UTC
I understand this causes a confusion. I'd suggest adding more explanatory comment to user and password field that this only applies on empty database. They would be only effective with --reset option which I would not recommend to use as it clears all data!

There were two concerns raised

> First: If installer run with only option '--foreman-admin-password' then it
> should change, 

> or should shows a warning if not requires to run second time instead of
> installer complete eveytime successfully.

Given the way how installer works - remembering values in answer file and always applying the full configuration, this is not something these options could provide. We could add add new options, e.g. --reset-admin-password but I don't think this is installer domain. If the use case is resetting forgotten password, I think we should add such functionality to foreman-maintain.

> Second, Currently installer is running and completing successfully without any 
> error while passing the new password and updating unnecessary password in
> 'satellite-answers.yaml' even same does not work for admin user:

This is because the installer successfully changed the default credentials that would be applied during empty DB seeding. This does not happen during second run, unless the DB has been wiped out.

So, would rephrasing the help text solve this if it sounded more like "Password of the initial admin user, default is randomly generated (current: "changeme"). This is only applicable for new installations, later changes are not reflected unless the database is reset."

Comment 5 vijsingh 2018-10-15 15:55:38 UTC
(In reply to Marek Hulan from comment #4)
> I understand this causes a confusion. I'd suggest adding more explanatory
> comment to user and password field that this only applies on empty database.
> They would be only effective with --reset option which I would not recommend
> to use as it clears all data!
> 
> There were two concerns raised
> 
> > First: If installer run with only option '--foreman-admin-password' then it
> > should change, 
> 
> > or should shows a warning if not requires to run second time instead of
> > installer complete eveytime successfully.
> 
> Given the way how installer works - remembering values in answer file and
> always applying the full configuration, this is not something these options
> could provide. We could add add new options, e.g. --reset-admin-password but
> I don't think this is installer domain. If the use case is resetting
> forgotten password, I think we should add such functionality to
> foreman-maintain.
> 
> > Second, Currently installer is running and completing successfully without any 
> > error while passing the new password and updating unnecessary password in
> > 'satellite-answers.yaml' even same does not work for admin user:
> 
> This is because the installer successfully changed the default credentials
> that would be applied during empty DB seeding. This does not happen during
> second run, unless the DB has been wiped out.
> 
> So, would rephrasing the help text solve this if it sounded more like
> "Password of the initial admin user, default is randomly generated (current:
> "changeme"). This is only applicable for new installations, later changes
> are not reflected unless the database is reset."

Thanks, As per my understanding below would help:

-> in satellite-installer - adding more explanatory comment to user and password field.
-> add reset password functionality to foreman-maintain.

Comment 6 Bryan Kearney 2019-01-08 13:31:20 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25170 has been resolved.

Comment 7 Apurva 2019-06-27 17:28:04 UTC
Verified

Verified on: Satellite 6.6.0 snap 7

This bug is not valid anymore as the options --foreman-admin-username admin --foreman-admin-password are now replaced with --foreman-initial-admin-username and --foreman-initial-admin-password

Comment 9 Bryan Kearney 2019-10-22 19:51:14 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-2019:3172


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