f1c8136556
Having all services in one giant haproxy file makes altering configuration for a service both painful and dangerous. Each service should be configured with a simple set of variables and rendered with a single unified template. Available are two new templates: * haproxy_single_service_listen.cfg.j2: close to the original style, but only one service per file * haproxy_single_service_split.cfg.j2: using the newer haproxy syntax for separated frontend and backend For now the default will be the single listen block, for ease of transition. Change-Id: I6e237438fbc0aa3c89a3c8bd706a53b74e71904b
65 lines
2.5 KiB
YAML
65 lines
2.5 KiB
YAML
---
|
|
project_name: "mariadb"
|
|
|
|
mariadb_services:
|
|
mariadb:
|
|
container_name: mariadb
|
|
group: mariadb
|
|
enabled: true
|
|
image: "{{ mariadb_image_full }}"
|
|
volumes:
|
|
- "{{ node_config_directory }}/mariadb/:{{ container_config_directory }}/:ro"
|
|
- "/etc/localtime:/etc/localtime:ro"
|
|
- "mariadb:/var/lib/mysql"
|
|
- "kolla_logs:/var/log/kolla/"
|
|
dimensions: "{{ mariadb_dimensions }}"
|
|
haproxy:
|
|
mariadb:
|
|
enabled: "{{ enable_mariadb|bool and not enable_external_mariadb_load_balancer|bool }}"
|
|
mode: "tcp"
|
|
port: "{{ mariadb_port }}"
|
|
frontend_tcp_extra:
|
|
- "option clitcpka"
|
|
- "timeout client 3600s"
|
|
backend_tcp_extra:
|
|
- "option srvtcpka"
|
|
- "timeout server 3600s"
|
|
- "option mysql-check user haproxy post-41"
|
|
custom_member_list: "{{ internal_haproxy_members.split(';') }}"
|
|
mariadb_external_lb:
|
|
enabled: "{{ enable_mariadb|bool and enable_external_mariadb_load_balancer|bool }}"
|
|
mode: "tcp"
|
|
port: "{{ mariadb_port }}"
|
|
frontend_tcp_extra:
|
|
- "option clitcpka"
|
|
- "timeout client 3600s"
|
|
backend_tcp_extra:
|
|
- "option srvtcpka"
|
|
- "timeout server 3600s"
|
|
custom_member_list: "{{ external_haproxy_members.split(';') }}"
|
|
|
|
####################
|
|
# Database
|
|
####################
|
|
database_cluster_name: "openstack"
|
|
database_max_timeout: 120
|
|
|
|
####################
|
|
# HAProxy
|
|
####################
|
|
internal_haproxy_members: "{% for host in groups['mariadb'] %}server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ mariadb_port }} check inter 2000 rise 2 fall 5{% if not loop.first %} backup{% endif %};{% endfor %}"
|
|
external_haproxy_members: "{% for host in groups['mariadb'] %}server {{ host }} {{ host }}:{{ mariadb_port }} check inter 2000 rise 2 fall 5{% if not loop.first %} backup{% endif %};{% endfor %}"
|
|
|
|
####################
|
|
# Docker
|
|
####################
|
|
mariadb_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-mariadb"
|
|
mariadb_tag: "{{ openstack_release }}"
|
|
mariadb_image_full: "{{ mariadb_image }}:{{ mariadb_tag }}"
|
|
mariadb_dimensions: "{{ default_container_dimensions }}"
|
|
|
|
########################################
|
|
# Vars used within recover_cluster.yml
|
|
########################################
|
|
mariadb_service: "{{ mariadb_services['mariadb'] }}"
|