Bug 1640136

Summary: foreman-maintain assumes the admin user is called admin
Product: Red Hat Satellite Reporter: Evgeni Golov <egolov>
Component: Satellite MaintainAssignee: Anurag Patel <apatel>
Status: CLOSED WONTFIX QA Contact: Nikhil Kathole <nkathole>
Severity: medium Docs Contact:
Priority: high    
Version: 6.4.0CC: apatel, inecas, kgaikwad, mbacovsk
Target Milestone: UnspecifiedKeywords: Triaged, UserExperience
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: 2019-12-03 12:53:23 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 Evgeni Golov 2018-10-17 12:17:41 UTC
Description of problem:
When deploying Foreman/Satellite, you can specify a different admin username with the --foreman-admin-username switch to the installer. By doing so, there is no "admin" user in the system after installation.

However, foreman maintain only tries to use "admin" when writing the custom config, and errors out when it can't use it.

See https://github.com/theforeman/foreman_maintain/blob/master/definitions/features/hammer.rb#L31

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


How reproducible:
100%

Steps to Reproduce:
1. install Foreman/Satellite with --foreman-admin-username bigboss
2. use foreman-maintain

Actual results:
config error is assumed and f-m aborts

Expected results:
f-m works (and asks for the right username)

Additional info:
Workaround: create a "admin" user, if Foreman/Satellite is down for some reason, you can create it directly in the DB:

echo "insert into users (login, firstname, lastname, mail, admin, auth_source_id, password_hash, password_salt, default_organization_id, lower_login, mail_enabled) values ('admin', 'admin', 'admin', 'root@localhost', true, 1, '818b6a109858fc8aac2cbc905f937dd4006c84aa', 'ab5b746dab13c619c83df529653a885709aa5fdd', 1, 'admin', true);" | sudo -u postgres psql foreman

This will create an "admin" user with "changeme" as password, don't forget to change it afterwards :)

Comment 2 Kavita 2018-11-15 07:09:24 UTC
Created redmine issue http://projects.theforeman.org/issues/25472 from this bug

Comment 3 Bryan Kearney 2019-11-04 14:33:54 UTC
The Satellite Team is attempting to provide an accurate backlog of bugzilla requests which we feel will be resolved in the next few releases. We do not believe this bugzilla will meet that criteria, and have plans to close it out in 1 month. This is not a reflection on the validity of the request, but a reflection of the many priorities for the product. If you have any concerns about this, feel free to contact Red Hat Technical Support or your account team. If we do not hear from you, we will close this bug out. Thank you.

Comment 4 Bryan Kearney 2019-12-03 12:53:23 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact Red Hat Technical Support. Thank you.