Code Monkey home page Code Monkey logo

ansible-role-maxscale's Introduction

Ansible Role: Maxscale Build Status

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.

Requirements

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.

Dependencies

None.

Installation

Using ansible galaxy cli:

ansible-galaxy install manala.maxscale

Using ansible galaxy requirements file:

- src: manala.maxscale

Role Handlers

Name Type Description
maxscale restart Service Restart Maxscale service

Role Variables

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

Configuration example (Galera cluster configuration)

# 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

Example playbook

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

Licence

MIT

Author information

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

ansible-role-maxscale's People

Contributors

gfaivre avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.