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

split keepalived config and refactoring #203

Closed
wants to merge 12 commits into from

Conversation

Kariton
Copy link
Contributor

@Kariton Kariton commented Jun 9, 2022

  • split task/main.yml in multiple files

  • use FQCN

  • use ansible_managed | comment

  • use loop instead of with_*

  • split keepalived configs into separated directories / files

  • keepalived_instances.INSTANCE.state is multiuse (the configuration file state / optional configuration state) -> absent | d(present) / ['MASTER', 'BACKUP']

@evrardjp
Copy link
Owner

evrardjp commented Jun 13, 2022

I see a lot of progress, thanks @Kariton !
We might want to refactor this in different PRs, but please keep up the good work :)


# Remove all keepalived configurations
# Clears entire {{ keepalived_config_directory_path }}
keepalived_flush_configuration: False
Copy link
Owner

Choose a reason for hiding this comment

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

We should not introduce a variable to flush the configuration, instead, the state of the other variables should help us figure out what to do (the variable contains the full state). If truly impossible to do, then the deployer can just run an ad-hoc ansible command to clean up (and not need an extra variable).

The idea of the previous config was that if you were to change it, you would never have something laying around that cause an issue of misconfiguration.

@Kariton
Copy link
Contributor Author

Kariton commented Jun 13, 2022

@evrardjp Thanks for that.

I know that I did a lot of changes and even correction to those.
And sorry for some unexpected mess within other PRs...

I actually think Im done within this overall draft.

In another branch I just started to work on an argument_specs constellation that is sufficient.
But that is a totally different / new thing for me and lightyears away to be another PR.

It is possible to slit this in different PRs.

How should I split this into different PRs?
""resolve pending PRs"

""general code update""

""feature / function update""

  • split task/main.yml in multiple files
  • split keepalived configs into separated directories / files
    • implement corresponding state handling
      • keepalived_instances.INSTANCE.state is multiuse (the configuration file state / optional configuration state) -> absent | d(present) / ['MASTER', 'BACKUP']

@evrardjp
Copy link
Owner

Before we go into subdivising this work into body of work that are reviewable separately, I will watch this PR for its concept.

What I can see at first glance:

A) the general code update concept is great. It can be one PR or 3. It definitely needs to be at least 3 commits though: 1 commit for fqcn, 1 commit for revert, 1 commit with loop refactoring. Please let's not forget any change in tox/molecule (ensure the right versions/dependencies).

B) Feature/Function update.
The ansible_managed is linked to how we do templating. I would do that into function update. (it's a new feature to record this).
task/main can indeed be split into multiple files, especially if those are very clear about their scope. I will check readability, as good readability increases contributions.
For the state multiuse, I think I like the concept, but I want to make sure it "feels as a whole" (disabling should change configuration/remove scripts). I need to review this in more details.

C) resolve existing PRs
I don't think we should solve existing PRs inside new PRs, instead we should promote collaboration. But maybe I am idealistic here ;)
I however, would be okay, to move things forward, that we work together on new PRs to fix the existing state. I want to say a big THANK YOU to you for taking that one. Or I should add https://media.giphy.com/media/KzM1lAfJjCWNq/giphy.gif .

Should we start with point C, and then move forward with A and B? What do you prefer? (I feel however that B should come after A)

@Kariton
Copy link
Contributor Author

Kariton commented Jun 13, 2022 via email

@Kariton
Copy link
Contributor Author

Kariton commented Jun 16, 2022

To continue my work on this I need some guidance.

My thoughts:
Before we can continue in a meaningful way we need to close as many PRs as possible.

As pointed out earlier my changes are destructive to some git mechanics - especially rebase.
This would mean that other pending PRs needs to be resolved prior to my changes as a rebase would be a hassle.
IIRC only the snap PR is somewhat problematic here.

I already altered some IMO useful "no-answer" PRs to help with that.
I might able to also include the snap PR but I know nothing about SNAP.

How I would like to continue:

  • wait for a "ready" state
    • set following PRs on hold
  • create PR to implement the targeted changes
    • split current tasks structure tasks/main.yml
    • split current template structure

I don't want to implement the tasks/main.yml split in my already existing PR "general code update" for the already stated reasons...

@evrardjp
Copy link
Owner

Hello,

I agree with you on the splitting, and started to merge some of those great PRs of yours.
I have some questions on those, so let's talk inside each PR.

I would love to keep the current draft PR open, as it gives a few ideas about the future.

Yet, we'll resolve in the different PRs :)

@Kariton
Copy link
Contributor Author

Kariton commented Jul 14, 2022

solved and not needed anymore as i found another solution which is sufficent:
#200 (comment)

@Kariton Kariton closed this Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants