This role will deal with the setup and configuration of MaxScale the Mysql/MariaDB proxy.
It's part of the Manala Ansible stack but can be used as a stand alone component.
This role is made to work with the mariadb maxscale debian packages, available on the mariadb repository. Please use the manala.apt role to handle it properly.
None.
Using ansible galaxy cli:
ansible-galaxy install manala.maxscale
Using ansible galaxy requirements file:
- src: manala.maxscale
Name | Type | Description |
---|---|---|
maxscale restart | Service | Restart Maxscale service |
Name | Default | Type | Description |
---|---|---|---|
manala_maxscale_config_file |
/etc/maxscale.cnf | String | Configuration file |
manala_maxscale_config_template |
config/empty.j2 | String | Default configuration template |
manala_maxscale_config |
[] | Array | Maxscale configuration options |
manala_maxscale_users_file |
/var/lib/maxscale/passwd | String | Configuration file |
manala_maxscale_users_template |
users/default.j2 | String | Default users file template |
manala_maxscale_network_users |
[] | Array | Maxscale network users |
# Using a custom template
manala_maxscale_config_template: "{{ playbook_dir ~ '/templates/maxscale/custom_template.j2' }}"
manala_maxscale_config:
- maxscale:
- threads: auto #Dedicated container
- Splitter Service:
- type: service
- router: readwritesplit
- servers: mariadb-1, mariadb-2, mariadb-3
- user: maxscale
- passwd: XXXXXXXXXXXXXX
- Splitter Listener:
- type: listener
- address: "{{ ansible_eth0.ipv4.address }}" # Ip of the host, can be omit default is listen all interfaces
- port: 3306
- socket: /tmp/ClusterMaster
- service: Splitter Service
- protocol: MySQLClient
- mysql-1.elao:
- type: server
- address: 172.16.X.XX
- port: 3306
- protocol: MySQLBackend
- mysql-2.elao:
- type: server
- address: 172.16.X.XX
- port: 3306
- protocol: MySQLBackend
- mysql-3.elao:
- type: server
- address: 172.16.X.XX
- port: 3306
- protocol: MySQLBackend
- Galera Monitor:
- type: monitor
- module: galeramon
- servers: mariadb-1, mariadb-1, mariadb-1
- user: maxscale
- passwd: XXXXXXXXXXX
- CLI:
- type: service
- router: cli
- CLI Listener:
- type: listener
- service: CLI
- protocol: maxscaled
- address: localhost
- port: 6603
maxscale_network_users:
# Generating with maxpasswd command
- name: elao
password: $1$MXS$nJC9UIcP/IWkgAGEhQSh1/
- name: maxscale-admin
password: $1$MXS$aTODkN/QXQSexlaH1dRdA0
- hosts: servers
roles:
- { role: manala.maxscale }
MIT
Manala (http://www.manala.io/)