manala.maxscale

#######################################################################################################

:exclamation: DEPRECATION :exclamation:

This repository and the associated role are deprecated in favor of the Manala Ansible Collection

You can find information on how to use it in the collection repository

#######################################################################################################

Ansible Role: Maxscale Build Status

:exclamation: Please report issues and send Pull Requests to the main Ansible Role repository :exclamation:

This role is for setting up and configuring Maxscale.

It is part of the Manala Ansible stack but can also work on its own.

Requirements

This role is designed to work with the mariadb maxscale Debian packages, which can be found in the mariadb maxscale repository. Please use the manala.apt role to manage it properly.

manala_apt_preferences:
  - maxscale@maxscale_2_4

Dependencies

None.

Installation

Ansible 2+

Using ansible galaxy command line interface:

ansible-galaxy install manala.maxscale

Using an ansible galaxy requirements file:

- src: manala.maxscale

Role Handlers

Name Type Description
maxscale restart Service Restart the Maxscale service

Role Variables

Name Default Type Description
manala_maxscale_install_packages ~ Array Packages required for installation
manala_maxscale_install_packages_default ['maxscale'] Array Default packages to install
manala_maxscale_config_file '/etc/maxscale.cnf' String Path to the configuration file
manala_maxscale_config_template 'config/_default.j2' String Path to the default configuration template
manala_maxscale_config ~ Array/String Configuration settings
manala_maxscale_configs_exclusive false Boolean Indicates whether configurations are exclusive
manala_maxscale_configs_dir '{{ manala_maxscale_config_file }}.d' String Path to the configurations directory
manala_maxscale_configs_defaults {} Array Path to the default configurations template
manala_maxscale_configs [] Array List of configurations
manala_maxscale_users_file '/var/lib/maxscale/passwd' String Path to the users file
manala_maxscale_users_template 'users/_default.j2' String Path to the default users template
manala_maxscale_network_users ~ Array Network users (unchanged if null)

Configuration Example (Galera Cluster Setup)

Config template

manala_maxscale_config_template: maxscale/custom_template.j2

Content-based configuration

manala_maxscale_config: |
  [maxscale]
  max_auth_errors_until_block = 0

  [admin]
  type = service
  router = cli

Old configuration format (deprecated)

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
  ...

Configurations

manala_maxscale_configs_exclusive: true
manala_maxscale_configs:
  # Content-based
  - file: foo.cnf
    config: |
      [foo-1]
      type = server
      address = foo-1
      port = 3306
      protocol = MariaDBBackend
  # Old configuration format (deprecated)
  - file: bar.cnf
    config:
      - foo-1:
        - type: server
        - address: foo-1
        - port: 3306
        - protocol: MariaDBBackend
  ...

Users

manala_maxscale_network_users:
  - name: foo
    password: $1$MXS$ilOCSZPnjmHjTz6B96SiJ1 # "foo" (generated by maxpasswd)
  - name: bar
    password: $1$MXS$M.YZOr2pNTgW87l7KQWLU/ # "bar" (generated by maxpasswd)

Example Playbook

- hosts: servers
  roles:
    - role: manala.maxscale

License

MIT

Author Info

Manala (http://www.manala.io/)

Informazioni sul progetto

Installation and configuration of Maxscale (MySQL/MariaDB Proxy)

Installa
ansible-galaxy install manala.maxscale
Licenza
Unknown
Download
3.5k
Proprietario
Manala is an open source project supported by the french web agency ELAO providing advanced ansible roles for website's infrastructures and far more.