New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installer review (allow to run katello-configure multiple times) #345
Conversation
looks very good to me |
@mccun934 If you could take a look on the concept - see the long description. Feel free to review puppet as well ;-) |
I'll try it out and let you know how it goes .. |
Added one RHBZ fix because I would get merging issues otherwise. |
/me is checking with puppet master |
I finished with testing katello-configure on Fedoras. I have implemented To test it, you need to build katello-* packages (src/ and puppet/ spec |
Few more fixes, PLEASE TEST so I can merge :-) |
first round of testing: $ katello-configure Failed, please check [/var/log/katello/katello-configure/db_migrate.log] more of a repo issue, than an issue with katello-configure. will continue with an updated rpm |
followup error $ katello-configure Failed, please check [/var/log/katello/katello-configure/db_migrate.log] $ cat /var/log/katello/katello-configure/db_migrate.log |
@xsuchy thanks, merged those fixes in manually for testing and katello-configure worked great. it was able to run multiple times and deal with the fact that previous runs failed. is katello-configure --reset_data=RESET_DATA supposed to work? I ran it and it returned in 1-2 seconds and didn't seem todo anything |
Its --reset-data=YES. I have to admit the --help page is not super clear, but man page is definitely better. Pushed a fix that will add this to the --help screen. |
Installer review (allow to run katello-configure multiple times)
https://fedorahosted.org/katello/wiki/Install updated, next nightly is today 14 PM EDT |
Installer review (allow to run katello-configure multiple times)
We have been working hard on katello-configure to improve the way it works. Since the installer is Puppet based, our main goal was to allow users to run it multiple times. Like Puppet does, installer do check everything and correct all deviations from what you configured using parameters. This was not possible since some dependency issues and usage of idempotent scripts like cpsetup.
Lots of changes were incorporated - various workarounds were removed and installer was tested with various scenarios. From now on, if you provision a clean installation or if you have existing one, you can always run katello-configure to make sure everything is okay. Please note all the katello-configure options are stored in the /etc/katello/katello-configure.conf so you can use it as an answer file:
katello-configure --answer-file=/etc/katello/katello-configure.conf
You can also provide different parameters and installer will re-configure everything. Please check logs carefully when changing options and report errors if you encouter any. Also note that changing org-name, user-name, user-pass and user-email will require resetting database.
And this also means you can easily switch between katello and headpin. Yes, this is possible and as easy as installing thumbslug plus:
katello-configure --deployment=headpin
katello ping
katello-configure --deployment=katello
katello ping
There is a new option --reset-data which drops all databases: katello, candlepin, pulp (also repos which were generated), elasticsearch and then starts initial configuration again. Since this is dangerous option, you need to provide case-sensitive "YES" to get the desired behavior.
Additional second option --reset-cache just removes all pulp downloaded RPMs from /var/lib/pulp/packages. If you provide them both, katello instance should be completly "clean". Please note all --reset-* options are not stored in the answer file for obvious reasons.
Example of full reset of a katello installation:
katello-configure --answer-file=/etc/katello/katello-configure.conf --reset-data=YES --reset-cache=YES
Basically this does the very same as katello-reset-dbs, but also makes sure all configuration values are correct. We will keep katello-reset-dbs script in git since it can be easily used for development setups.
Katello-configure will also work for upgrades. To upgrade existing installation, use katello-upgrade script first which will do all data migrations which are needed and THEN you can run katello-configure as many times as you want to re-configure stuff, because it always should describe correct state of an installation. It is not recommended to run katello-configure BEFORE katello-upgrade.
IMPORTANT: Since there are big changes in the installer, you need to do clean installation for the first time. If you try to upgrade to the new version of the installer, it will likely fail with a puppet error.
Please report all katello-configure failures along with katello-debug output. It creates nice tarball with all the important logs there (passwords are removed). We recommend to attach it as private comments into bugzilla. Before you report, please try to restart all backend engines and then katello to see if it helps and provide this information.
There are also two more options -b and -d. The first one turns off progress bars logging puppet also on the standard output and the second enables debug messages to be avaiable also on stdout (hidden by default). New version also strips out annoying color codes in the katello-configure log files.
As a side effect, I created a page describing installation of katello via puppet itself (without katello-configure script which only collects params and runs puppet): https://fedorahosted.org/katello/wiki/InstallViaPuppet
ACKS: @mbacovsky @mmccune
Do not merge this request as I would like to retab some files before merging. Thanks.