keepalived configuration added

This commit is contained in:
Andrea Dell'Amico 2020-09-30 19:02:46 +02:00
parent 27d20be413
commit d34b9f512f
2 changed files with 39 additions and 0 deletions

View File

@ -20,3 +20,6 @@ docker_swarm_portainer_service_port: '8000'
docker_swarm_haproxy_additional_services: [] docker_swarm_haproxy_additional_services: []
# - { acl_name: 'service', acl_rule: 'hdr_dom(host) -i service.example.com', service_name: 'service-', service_replica_num: '1', service_port: '9999', service_overlay_network: 'service-network' } # - { acl_name: 'service', acl_rule: 'hdr_dom(host) -i service.example.com', service_name: 'service-', service_replica_num: '1', service_port: '9999', service_overlay_network: 'service-network' }
docker_swarm_keepalived_vrouter_id: 205
docker_swarm_keepalived_floating_ip: '127.0.0.1/8'
docker_swarm_keepalived_instance_name: 'VI_HAPROXY_1'

View File

@ -2,3 +2,39 @@
haproxy_docker_container: True haproxy_docker_container: True
haproxy_docker_compose_dir: /src/haproxy_swarm haproxy_docker_compose_dir: /src/haproxy_swarm
haproxy_ha_with_keepalived: True haproxy_ha_with_keepalived: True
keepalived_install: True
keepalived_vrouter_id: '{{ docker_swarm_keepalived_vrouter_id }}'
keepalived_use_unicast: False
keepalived_floating_ip1: '{{ docker_swarm_keepalived_floating_ip }}'
keepalived_instance1_name: '{{ docker_swarm_keepalived_instance_name }}'
keepalived_nagios_check: False
keepalived_service_to_check: 'haproxy'
keepalived_script1_check: "/usr/bin/docker container ls --filter name=haproxy | /bin/grep haproxy"
keepalived_scripts:
- name: '{{ keepalived_script1_name }}'
script: '{{ keepalived_check_script }}'
# In seconds
interval: 2
# Priority increment
weight: -20
fall: 2
raise: 2
keepalived_instances:
- name: '{{ keepalived_instance1_name }}'
interface: '{{ ansible_default_ipv4.interface }}'
state: BACKUP
vrouter_id: '{{ keepalived_vrouter_id }}'
notify: '{{ keepalived_notify_script }}'
priority: '{{ keepalived_inst_priority }}'
nopreempt: True
v_addr:
- '{{ keepalived_floating_ip1 }}'
track_script:
- '{{ keepalived_script1_name }}'
track_interface:
- '{{ ansible_default_ipv4.interface }}'
authentication: PASS
authpass: '{{ keepass_auth_pwd }}'