cloudweeb.mariadb

Ansible Role for MariaDB

Build Status

This is an Ansible role used to install the MariaDB server.

Requirements

No special requirements needed.

Role Variables

mariadb_version: 10.3   # The version of MariaDB you want to install.

mariadb_root_password: password  # Root password for MariaDB.

# Additional packages for MariaDB
mariadb_packages: []  # You can add packages like MariaDB-devel or MariaDB-shared here.

# Configuration for MariaDB network
mariadb_skip_networking: false  # Set to true to skip networking.
mariadb_skip_name_resolve: false # Set to true to skip name resolution.
mariadb_bind_address: '0.0.0.0'   # The address MariaDB listens on.
mariadb_port: '3306'              # The port MariaDB listens on.

mariadb_pid_file: /var/lib/mysql/{{ ansible_fqdn }}.pid  # PID file location.

# Log configuration for MariaDB
mariadb_slow_query_log: false  # Set to true to enable slow query logging.
mariadb_error_log_file: /var/lib/mysql/{{ ansible_fqdn }}.err  # Location for error logs.
mariadb_slow_query_log_file: /var/lib/mysql/{{ ansible_fqdn }}.slow-query.log  # Location for slow query logs.

# Resource configuration for MariaDB
mariadb_key_buffer_size: 16K
mariadb_max_allowed_packet: 1M
mariadb_table_open_cache: '2000'
mariadb_sort_buffer_size: 64K
mariadb_read_buffer_size: 256K
mariadb_read_rnd_buffer_size: 256K
mariadb_net_buffer_length: 2K
mariadb_thread_stack: 240K
mariadb_max_connections: '50'
mariadb_max_user_connections: '25'
mariadb_wait_timeout: '10'
mariadb_interactive_timeout: '50'
mariadb_long_query_time: '5'

# InnoDB configuration for MariaDB
mariadb_innodb_file_per_table: true  # Use one file per table.
mariadb_innodb_buffer_pool_size: 128M  # Buffer pool size.
mariadb_innodb_log_file_size: 48M  # Log file size.
mariadb_innodb_buffer_pool_instances: '1'  # Number of buffer pool instances.

mariadb_users: []  # List of users to create.
# Example:
# - name: example
#   password: example
#   priv: "*.*:USAGE"
#   state: present

mariadb_databases: []  # List of databases to create.
# Example:
# - name: example
#   state: present

Dependencies

No dependencies.

Example Playbook

- hosts: servers
  vars:
    mariadb_root_password: "{{ lookup('password', '/tmp/mariadb_root_password length=15 chars=ascii_letters,digits,hexdigits') }}"

    mariadb_users:
      - name: example
        password: "{{ lookup('password', '/tmp/mariadb_example_password length=15 chars=ascii_letters,digits,hexdigits') }}"
        priv: "example.*:ALL"
        state: present

    mariadb_databases:
      - name: example
        state: present

  roles:
    - role: cloudweeb.mariadb

License

This role is licensed under BSD/MIT.

Author Information

Agnesius Santo Naibaho

Informazioni sul progetto

Install MariaDB Server

Installa
ansible-galaxy install cloudweeb.mariadb
Licenza
mit
Download
469
Proprietario