0023: Converge Foreman and Katello adminstration scripts#26
0023: Converge Foreman and Katello adminstration scripts#26ehelms wants to merge 1 commit intotheforeman:masterfrom
Conversation
|
|
||
| * centralize adminstration into hammer_cli_foreman_admin | ||
| - this would allow a single repository to manage scripts | ||
| - this would allow users to have discoverability (e.g hammer admin --help to see list of optional commands) |
There was a problem hiding this comment.
I like the idea, but it should be somehow noted that such commands can be run only on satellite server and ideally have some detection so if it's ran somewhere else, user would get clear error message. (rpm -q $package might be enough).
There was a problem hiding this comment.
typo at the end and centralization
| * foreman-tail | ||
| * foreman-rake | ||
| * foreman-config | ||
| * hammer_cli_foreman_admin |
There was a problem hiding this comment.
katello-selinux-relabel, katello-certs-check, katello-certs-sign, foreman-selinux-relabel
There was a problem hiding this comment.
These are all in katello-selinux, I'd keep that package.
| * hammer_cli_foreman_admin | ||
|
|
||
| Based on the current design of the scripts and where they live, the following design has been put forth: | ||
|
|
There was a problem hiding this comment.
Probably goes without saying but we should also leave the current scripts locations working with a deprecated message for at least one release.
89163c9 to
7f5d3c3
Compare
|
I updated this RFC based on comments (sorry if I missed any, it has been a while) and opened an initial PR to get some design discussion going. |
|
I was looking into very similar context while looking into health-checking, remediation scripts and upgrade helpers. My additional requirements are:
This takes us to lower the dependencies on other things that are delivered as part of foreman/satellite (including even hammer). I'm currently putting a POC of the code structure together, will have something to show next week. |
|
|
||
|
|
||
| # Drawbacks | ||
| [drawbacks]: #drawbacks |
There was a problem hiding this comment.
hammer is primarily used for taking to the foreman via API. This includes issues, such as:
- slow start time: since there is already quite a lot of functionality, it takes more and more time to load (on my setup, 2 seconds just to load the whole thing. For now, I don't see too much benefits of building the tool as plugin into hammer, vs. standalone tool around clamp, limiting and focusing on maintenance tasks.
There was a problem hiding this comment.
I see this as two different pieces:
- hammer the code/library/integration with API
- hammer as THE CLI tool for Foreman
As a user, it is nice to be able to have one tool and let it tell you about the functionality you can do from an interface perspective (ignoring whats under the hood).
I suppose two CLI tools would be OK and limit user's required sphere of knowledge. For example, OpenShift has oc and oadm. However, I do find it annoying that you have to still figure out what you can do in one tool and what operations you do in the other tool.
There was a problem hiding this comment.
Yeah, I thought more on using hammer as a framework, integrating "hammer debug" into the foreman's "hammer" command was not good idea, it should have been perhaps separate command like this one.
What I find very useful is subcommands capabilities of hammer, this will be collections of subcommands essentially. If clamp (or whatever we choose to work with) provides that, that is fine I think.
In any case, this should be definitely a separate binary foreman-maintain instead of hammer (to be honest I think foreman-cli should be named foreman-cli from the day one).
There was a problem hiding this comment.
I see no issue in having a separate maintenance tool. I see hammer as how the operator interacts with Foreman operationally. Maintenance and/or debug tasks IMHO should always be in a separate tool, as there will be tasks that can't be run remotely. Additionally, as an admin, I run hammer on my workstation.
I dont want to have to remember 'commands that I can only run locally' versus 'commands that I can run remotely'
| # Alternatives | ||
| [alternatives]: #alternatives | ||
|
|
||
| 1) Use something other than hammer_cli_foreman_admin for CLI-ing scripts together like regular opt-parse |
|
|
||
| Subcommands: | ||
| debug Generate debug output for upload | ||
| services Manage status of services |
There was a problem hiding this comment.
I would rename this to health-checks
There was a problem hiding this comment.
I feel like they are two distinct pieces, solely because 'services' does more than 'check'. The current katello-services tool provides start, stop and restart abilities thus managing services. We could split out the status aspect.
| backup Generate server backup | ||
| restore Use previously generated backup to restore server | ||
| remove Remove all RPMs and configuration from the server | ||
| tail Tail all relevant logs |
There was a problem hiding this comment.
another administrative tasks:
- upgrades - I don't think the current way of doing so inside installer hooks is a good approach
- remediation scripts - fixes/suggestions for things we know might get wrong
|
Whichever route we go, I'd love to avoid the "plugin" style for administration tooling and scripts and have a single repository and tool for all functionality. |
|
This complies with the design decisions we do: what we need to address is that the tool needs to be sensitive enough on what's present on the system it's run against and offer just the things that are relevant to the version of the system (upstream vs. downstream, plugins presence, registered proxies etc.) |
|
I am very happy we are building such a tool, I will do my part and rewrite foreman admin logging subcomand into this form once you have the first release and deprecate the old one. |
No description provided.