Giter VIP home page Giter VIP logo

ansible-role-maxscale's Introduction

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

❗ DEPRECATION ❗

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

You will find informations on its usage on the collection repository

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

Ansible Role: Maxscale Build Status

Report issues and send Pull Requests in the main Ansible Role repository

This role will deal with the setup and configuration of Maxscale.

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 maxscale repository. Please use the manala.apt role to handle it properly.

manala_apt_preferences:
  - maxscale@maxscale_2_4

Dependencies

None.

Installation

Ansible 2+

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_install_packages ~ Array Dependency packages to install
manala_maxscale_install_packages_default ['maxscale'] Array Default dependency packages to install
manala_maxscale_config_file '/etc/maxscale.cnf' String Configuration file path
manala_maxscale_config_template 'config/_default.j2' String Default configuration template path
manala_maxscale_config ~ Array/String Configuration
manala_maxscale_configs_exclusive false Boolean Configurations exclusivity
manala_maxscale_configs_dir '{{ manala_maxscale_config_file }}.d' String Configurations dir path
manala_maxscale_configs_defaults {} Array Default configurations template path
manala_maxscale_configs [] Array Configurations
manala_maxscale_users_file '/var/lib/maxscale/passwd' String Users file path
manala_maxscale_users_template 'users/_default.j2' String Default users template path
manala_maxscale_network_users ~ Array Network users (untouched if null)

Configuration example (Galera cluster configuration)

Config template

manala_maxscale_config_template: maxscale/custom_template.j2

Content based config

manala_maxscale_config: |
  [maxscale]
  max_auth_errors_until_block = 0

  [admin]
  type = service
  router = cli

Dict's array based config (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
  - 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:
    - type: server
    - address: 172.16.X.XX
    - port: 3306
    - protocol: MySQLBackend
  - mysql-2:
    - type: server
    - address: 172.16.X.XX
    - port: 3306
    - protocol: MySQLBackend
  - mysql-3:
    - 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

Configs

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
  # Dict's array based (deprecated)
  - file: bar.cnf
    config:
      - foo-1:
        - type: server
        - address: foo-1
        - port: 3306
        - protocol: MariaDBBackend
  # Dict's array (deprecated)
  - file: bar.cnf
    config:
      - foo-1:
        - type: server
        - address: foo-1
        - port: 3306
        - protocol: MariaDBBackend
  # Template cnf
  - file: template.cnf
    template: my_maxscale_template.cnf.j2
    config:
      Foo: bar
  # Ensure config is absent
  - file: absent.cnf
    state: absent # "present" by default
  # Ignore config
  - file: ignore.cnf
    state: ignore
  # Flatten configs
  - "{{ my_custom_configs_array }}"

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

Licence

MIT

Author information

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

ansible-role-maxscale's People

Contributors

greedybro avatar hyvs avatar nervo avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

l00ptr heartshare

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.