-
Notifications
You must be signed in to change notification settings - Fork 101
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
Add more execution granularity / idempotency #200
Comments
hello! I am back from vacation, I will read this as soon as possible. |
There are a few points to remember, and that can clarify why we do the current way (doesn't mean we shouldn't improve!)
I am not against the feature, but I am not seeing its value yet, outside the fact that you have to deal with smaller files (nice!) but also more ACLs (less nice), and the fact that the run is getting slower due to more tasks (less nice). Am I missing something obvious? |
Thanks for the feedback, We are using keepalived and IPVS as our loadbalancer (plain routing).
This was just some fix idea as example. But you are right, its not ideal. The will be restarted is not totally wrong - as the current handler would do that. More tasks will definitely slow the tasks execution down.
Based on the I dont know if a restart is for any particular configuration needed. |
Here they talk about a similar thing. voxpupuli/puppet-keepalived#52
|
Yeah, reload is definitely better, just it was not working with the ansible modules long ago. Would you be okay to create a PR, and we iterate together on it? There are many things that deserve a refresh -- I would be happy to start it, but would need your help on making sure it fits your needs... Maybe you can start by writing the tests? |
Hey, I will create a fork with a general "kind of rework" and we can see what those changes would look like. And about the testing part... |
hey, don't worry, we can work on this together :) This way we can come with the greatest ideas and make this role even better! |
Hey ho, I finally managed to test some stuff and got this:
would love to get some feedback. Greetings, |
Hey, My But Im not that sure about the |
I propose we discuss this in the relevant PRs. Thank you for your contributions! |
@evrardjp but TBO i dont know how to do that in detail. what i got so far: - hosts: loadbalancers, proxy01.example.tld
vars:
server_groups_name: 'proxy'
tasks:
- name: get real_server configuration
ansible.builtin.debug:
var: hostvars[groups['loadbalancers'][0]]['keepalived_virtual_server_groups'] | selectattr('name', 'equalto', server_groups_name) | map(attribute='real_servers') | first | selectattr('ip', 'equalto', hostvars[groups['squiddev'][0]]['ansible_default_ipv4']['address'])
run_once: true
ok: [loadbalancer01.example.tld] => {
"hostvars[groups['loadbalancers'][0]]['keepalived_virtual_server_groups'] | selectattr('name', 'equalto', server_groups_name) | map(attribute='real_servers') | first | selectattr('ip', 'equalto', hostvars[groups['squiddev'][0]]['ansible_default_ipv4']['address'])": [
{
"ip": "172.28.20.31",
"port": 3128,
"tcp_checks": [
{
"connect_port": 3128,
"connect_timeout": 1,
"delay_before_retry": 2,
"retry": 2
}
],
"weight": 1
}
]
} but how can i create a it will fit my goals if i can use my example playbook #209 (comment) and replace the would you mind lending me a hand on this matter as im stuck ATM? |
I think i actually got it. {% set virtual_server_group_list = [] %}
{% for virtual_server_group in keepalived_virtual_server_groups %}
{% set real_server_list = [] %}
{% for real_server in virtual_server_group.real_servers %}
{% if real_server.ip == hostvars[groups['squiddev'][0]]['ansible_default_ipv4']['address'] %}
{% set real_server = real_server | combine({'weight':0}) %}
{% endif %}
{% set real_server_list = real_server_list.append( real_server ) %}
{% endfor %}
{% set virtual_server_group = virtual_server_group | combine({'real_servers':real_server_list}) %}
{% set virtual_server_group_list = virtual_server_group_list.append( virtual_server_group ) %}
{% endfor %}
{{ virtual_server_group_list }} |
will create a PR for documentation purposes - this is no longer needed. |
Wow you were fast, I didn't get the chance to help you yet! Congrats! I approve the idea of documenting it :) |
Hey folks,
What do you think about splitting the templates in more granular single files?
We do a similar thing with our old-school hand-managed keepalived installations.
you already have a nice base to split them IMO.
I think about the following deployed structure:
Where the corresponding content is like this:
Why?
The goal is simpler configuration management.
This might also include the templates.
(even if some tasks get a bit messy)
This will add the ability to manage subsets of the keepalived configuration as needed.
Especially the function to edit the
keepalived_virtual_server_groups
for automated backend maintenance.Simple Playbook /
pre_tasks
etc. could disablereal_servers
.keepalived_virtual_server_groups.name
and every other (sub-)configuration has be the desired state as it will replace/etc/keepalived/services/httpd.conf
Simple Playbook /
post_tasks
etc. could replacevips
.keepalived_virtual_server_groups.name
and every other (sub-)configuration has be the desired state as it will replace/etc/keepalived/groups/httpd.conf
What is needed?
Intensive planning and testing to not break anything.
Many dict's now need a "state" value and following new tasks:
{{ item }}.state | d(present) == "absent"
{{ item }}.state | d(present) == "present"
ansible.builtin.template
needs to run in different loopsI may missed something totally.
This was just written by things I know and remember.
What do you think?
Or do you know something I don't? :)
Greetings,
Kariton
EDIT1:
added
service restart VS. reload
toWhat is needed?
The text was updated successfully, but these errors were encountered: