Skip to content

Commit

Permalink
Keepalived: Move to Debian
Browse files Browse the repository at this point in the history
  • Loading branch information
quartje committed Jul 3, 2024
1 parent cee7a26 commit ca2692d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
9 changes: 3 additions & 6 deletions roles/keepalived/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
- name: Install procps-ng
yum:
name: procps-ng
state: present

---
- name: Ensure nonlocal ipv4 bind kernel parameter is set
sysctl:
name: net.ipv4.ip_nonlocal_bind
Expand All @@ -14,9 +10,10 @@
group:
name: mysqlusers
state: present
when: "'dbcluster_nodes' in group_names"

- name: Install keepalived
yum:
package:
name: keepalived
state: present
register: keepalived_package_installed
Expand Down
10 changes: 7 additions & 3 deletions roles/keepalived/templates/keepalived_loadbalancer.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ vrrp_script chk_maint {
vrrp_instance ipv4 {
interface {{ ansible_default_ipv4.interface }} # interface to monitor
state {{ keepalived.state_master }}
virtual_router_id 55 # Assign one ID for this route
virtual_router_id {{ vrrp_id_ipv4 }} # Assign one ID for this route
priority {{ keepalived.masterprio }} # 101 on master, 100 on backup
advert_int 1
authentication {
Expand All @@ -35,9 +35,13 @@ vrrp_instance ipv4 {
vrrp_instance ipv6 {
interface {{ ansible_default_ipv4.interface }}
state {{ keepalived.state_backup }}
virtual_router_id 56
virtual_router_id {{ vrrp_id_ipv6 }}
priority {{ keepalived.backupprio }}
advert_int 5
advert_int 1
authentication {
auth_type PASS
auth_pass {{ keepalived_loadbalancer_vrrp_password }}
}
virtual_ipaddress {
{% if haproxy_sni_ip.ipv6 is defined %}
{{ haproxy_sni_ip.ipv6 }}
Expand Down

0 comments on commit ca2692d

Please sign in to comment.