Skip to content
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

Consolidate existing server setting CLI tools #19848

Merged

Conversation

d-m-u
Copy link
Contributor

@d-m-u d-m-u commented Feb 19, 2020

We don't have current functionality for setting a server setting once for all servers.
It's probably all going to be wrong, but we have to start somewhere.

I'll link the issue when I'm more sure that this is the right approach which honestly might not be ever — as Joe said, the downside of this is that it requires that we push out this server setting change for each new server added to an environment.

@miq-bot miq-bot added the wip label Feb 19, 2020
@d-m-u d-m-u force-pushed the adding_option_to_copy_server_settings_pass_one branch 4 times, most recently from 1549157 to a320678 Compare February 19, 2020 13:13
@d-m-u
Copy link
Contributor Author

d-m-u commented Feb 19, 2020

@miq-bot assign @jrafanie

@jrafanie
Copy link
Member

The thing about this approach is it's a net +3 lines in the existing script and we get to delete the old script. I don't see any feature we lose. The only downside is we aren't setting it at a zone/region level, so you need to do it for any new servers but that was the case for the old script.

We should link to #19747 and have @evertmulder review this to ensure it handles the existing use cases. Also, is the issue you were trying to fix in #19441 also a problem with this PR's approach?

@d-m-u d-m-u force-pushed the adding_option_to_copy_server_settings_pass_one branch from a320678 to 6ec0126 Compare February 20, 2020 16:24
@d-m-u
Copy link
Contributor Author

d-m-u commented Feb 24, 2020

@evertmulder any chance you might be able to address #19848 (comment) please?

@d-m-u d-m-u changed the title [WIP] Add first pass at setting global server settings Add first pass at setting global server settings Feb 25, 2020
@d-m-u
Copy link
Contributor Author

d-m-u commented Feb 25, 2020

@miq-bot add_label enhancement

@miq-bot miq-bot added enhancement and removed wip labels Feb 25, 2020
@Fryguy
Copy link
Member

Fryguy commented Mar 3, 2020

Why does this set it server by server as opposed to setting it at the region level once?

@d-m-u
Copy link
Contributor Author

d-m-u commented Mar 3, 2020

Because I liked option two better: #19747 (comment)

@Fryguy
Copy link
Member

Fryguy commented Mar 3, 2020

I don't like option 2 specifically because it doesn't account for new servers. The only con there that seems to make sense is that you have to deal with servers that have the value already overwritten, but that is handled already via the magic settings keywords (I think it's <enforce>, but I'd have to check)

EDIT: The magic value is <<reset>> and you would apply it to each server to tell it to inherit a value. I thought there was a method or something to enforce the value top-down, but I can't find it offhand.

@jrafanie
Copy link
Member

jrafanie commented Mar 4, 2020

I don't like option 2 specifically because it doesn't account for new servers.

It's replacing tools/server_settings_replicator/server_settings_replicator.rb , which also didn't account for new servers, and the code added was so trivial, I was fine with doing this for now especially due to the following...

The only con there that seems to make sense is that you have to deal with servers that have the value already overwritten, but that is handled already via the magic settings keywords (I think it's <enforce>, but I'd have to check)

Are you able to edit/view settings for region/zone in the UI/api? For example, if you blasted a value for a region/zone and wanted to confirm it in the UI/api, I'm not sure if that's easy to do. I know it works in the backend but if it's not in the UI/api, it might make sense to do a more equivalent replacement script while we determine what's missing in the region/zone settings work.

@Fryguy
Copy link
Member

Fryguy commented Mar 4, 2020

Are you able to edit/view settings for region/zone in the UI/api?

Yes. You can view and edit the settings at any level. API can also do it at any level.

@jrafanie
Copy link
Member

jrafanie commented Mar 4, 2020

Are you able to edit/view settings for region/zone in the UI/api?

Yes. You can view and edit the settings at any level. API can also do it at any level.

TMYK. Cool. I'll have to review it with @d-m-u @yrudman as I think he implemented some of it. I'm not sure how to view settings at the region/zone level.

Before this PR, we had 2 scripts saving server based settings:

tools/server_settings_replicator/server_settings_replicator.rb
tools/configure_server_settings.rb

After this PR, we have most if not all of the former's features by adding 3 lines to the latter. I question if we should first deprecate the former script but nevertheless, it's a surgical replacement.

We can implement blasting region/zone settings later on to solve the problem of having to update settings to new servers but my hope was first to remove the nearly duplicate script first. Also, region/zone settings isn't a direct replacement of the former script so I thought this would be easier to take in steps.

@d-m-u d-m-u force-pushed the adding_option_to_copy_server_settings_pass_one branch from 6ec0126 to 3499127 Compare March 5, 2020 15:51
@d-m-u d-m-u requested a review from gtanzillo as a code owner March 5, 2020 15:51
Yes it's probably all going to be wrong, but we have to start somewhere
@d-m-u d-m-u force-pushed the adding_option_to_copy_server_settings_pass_one branch from 3499127 to c60d50c Compare March 5, 2020 15:58
@miq-bot
Copy link
Member

miq-bot commented Mar 5, 2020

Checked commit d-m-u@c60d50c with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.20.0, and yamllint
1 file checked, 1 offense detected

tools/configure_server_settings.rb

@jrafanie
Copy link
Member

jrafanie commented Mar 5, 2020

Add first pass at setting global server settings

Maybe let's rename this PR to "Consolidate existing server setting CLI tools". This PR's intention was to de-duplicate our existing scripts down to one tool to set server settings. It doesn't prevent us from adding zone/region setting support.

@d-m-u d-m-u changed the title Add first pass at setting global server settings Consolidate existing server setting CLI tools Mar 5, 2020
Copy link
Member

@jrafanie jrafanie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging. This PR consolidates 2 scripts that set server settings into 1 by adding 3 whole lines to the existing script. While region/zone settings are possible in the future, it's outside the scope of this PR and far more complicated than 3 lines of code.

@jrafanie jrafanie modified the milestone: Kasparov Mar 27, 2020
@jrafanie jrafanie added the core label Mar 27, 2020
@jrafanie jrafanie merged commit 7f454fc into ManageIQ:master Mar 27, 2020
@d-m-u d-m-u deleted the adding_option_to_copy_server_settings_pass_one branch March 27, 2020 13:57
@d-m-u
Copy link
Contributor Author

d-m-u commented Apr 2, 2020

@miq-bot add_label jansa/yes

simaishi pushed a commit that referenced this pull request Apr 16, 2020
…tings_pass_one

Consolidate existing server setting CLI tools

(cherry picked from commit 7f454fc)
@simaishi
Copy link
Contributor

Jansa backport details:

$ git log -1
commit 4c90e011031726f0bd979713fa514b51599a4682
Author: Joe Rafaniello <[email protected]>
Date:   Fri Mar 27 09:56:59 2020 -0400

    Merge pull request #19848 from d-m-u/adding_option_to_copy_server_settings_pass_one

    Consolidate existing server setting CLI tools

    (cherry picked from commit 7f454fc8b0fa8949df7b5de7b370b29cbc097a26)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants