ansible-roles/maxscale/templates/maxscale.cnf.j2
Mathieu Trossevin 94f088e1bf Create role to install MariaDB MaxScale
This role have to add the official MariaDB MaxScale repository as
maxscale isn't in the Debian repositories. Moreover as maxscale need two
mysql users to works, the role can also create these users if requested
and ansible has access to a master server.
2020-06-18 10:58:15 +02:00

44 lines
1.1 KiB
Django/Jinja
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[maxscale]
threads=auto
{% for server in maxscale_mysql_servers %}
[{{ server['name'] }}]
type=server
address={{ server['address'] }}
port={{ server['port']|default(3306) }}
protocol=MariaDBBackend
{% endfor %}
[MariaDB-Monitor]
type=monitor
module=mariadbmon
servers={% for server in maxscale_mysql_servers %}{{ server['name'] }}{% if not loop.last %}, {% endif %}{% endfor %}
user={{ maxscale_monitor_user }}
{% if encrypted_maxscale_monitor_password is none %}
password={{ encrypt_maxscale_monitor_password_result['stdout'] }}
{% else %}
password={{ encrypted_maxscale_monitor_password }}
{% endif %}
monitor_interval=2000
{% for service in maxscale_services %}
[{{ service['name'] }}-Service]
type=service
router={{ service['router'] }}
cluster=MariaDB-Monitor
user={{ maxscale_mysql_user }}
{% if encrypted_maxscale_mysql_password is none %}
password={{ encrypt_maxscale_mysql_password_result['stdout'] }}
{% else %}
password={{ encrypted_maxscale_mysql_password }}
{% endif %}
[{{ service['name'] }}-Listener]
type=listener
service={{ service['name'] }}-Service
protocol=MariaDBClient
port={{ service['port'] }}
{% endfor %}