Bug 1632101

Summary: Satellite installer with option foreman-admin-password not working as expected.
Product: Red Hat Satellite 6 Reporter: Sagar Lutade <slutade>
Component: InstallerAssignee: Chris Roberts <chrobert>
Status: VERIFIED --- QA Contact: Devendra Singh <desingh>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: abakshi, chrobert, egolov, ehelms, mhulan, nkathole, slutade, vijsingh
Target Milestone: 6.6.0Keywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
URL: https://projects.theforeman.org/issues/25170
Whiteboard:
Fixed In Version: foreman-installer-1.21.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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