Bug #25472
closedforeman-maintain assumes the admin user is called admin
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1640136
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 :)