OpenConext / OpenConext-deploy

Ansible-based deployment automation for the OpenConext platform
Apache License 2.0
12 stars 21 forks source link

Haproxy management role: #451

Closed quartje closed 2 months ago

quartje commented 3 months ago

This allows you to for example to a location based loadbalancer failover. Suppose this is the backend server config:

in haproxy_applications, you have:

haproxy_applications:

  - name: engine
    .........
    servers: "{{ docker_bluered_servers }}"
docker_bluered_servers:
   - { ip: "192.168.86.10", label: "DOCKER1RED", location: "amsterdam"}
   - { ip: "192.168.86.11", label: "DOCKER2BLUE", location: "utrecht"}

You can then do:

ansible-playbook -i  inventory --tags haproxy_mgnt  playbook_haproxy.yml  -l loadbalancer  -D \
-e weight=10   -e app_name=engine -e app_filter=location -e app_filtervalue=amsterdam

The weight in Amsterdam will be set to 10%, and in Utrecht to 90%