Skip to content

cloudpunks/ansible-mariadb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mariadb

Source Code General Workflow Readme Workflow Galaxy Workflow License: Apache-2.0 Ansible Role

Ansible role to install and configure a simple MariaDB.

Sponsor

Building and improving this Ansible role have been sponsored by my current and previous employers like Cloudpunks GmbH and Proact Deutschland GmbH.

Table of content


Requirements

  • Minimum Ansible version: 2.10

Default Variables

mariadb_backup_addition_script

Additional commands at the end of the script

Default value

mariadb_backup_addition_script:

mariadb_backup_cron

A simple cron timing definition like hourly, daily or weekly

Default value

mariadb_backup_cron: daily

mariadb_backup_enabled

Enable or disable the backup script

Default value

mariadb_backup_enabled: false

mariadb_backup_formatting

Date format for the backup folder name

Default value

mariadb_backup_formatting: '%F'

mariadb_backup_ignore

Ignoring this filter via grep on database selection

Default value

mariadb_backup_ignore: (_backup|mysql|sys|information_schema|performance_schema)

mariadb_backup_path

Path to store the backups

Default value

mariadb_backup_path: /var/lib/mysql/_backup

mariadb_backup_retention

Retention period to keep backups

Default value

mariadb_backup_retention: 7

mariadb_bind_address

Bind address for the server

Default value

mariadb_bind_address: 0.0.0.0

mariadb_cpu_shares

CPU shares with Docker deployment

Default value

mariadb_cpu_shares:

Example usage

mariadb_cpu_shares: '512'

mariadb_database

Database used within docker deployment

Default value

mariadb_database:

mariadb_default_folders

List of default folders to create

Default value

mariadb_default_folders:
  - /etc/systemd/system/mariadb.service.d
  - /etc/mysql
  - /etc/mysql/mariadb.conf.d

mariadb_default_labels

List of default labels to assign to docker

Default value

mariadb_default_labels: []

mariadb_default_publish

List of default port publishing for docker

Default value

mariadb_default_publish: []

Example usage

mariadb_default_publish:
  - 127.0.0.1:3306:3306

mariadb_default_volumes

List of default volumes to mount for docker

Default value

mariadb_default_volumes:
  - /var/lib/mysql:/var/lib/mysql

mariadb_exporter_args

List of arguments joined for the executable

Default value

mariadb_exporter_args: []

mariadb_exporter_collect_info_schema_tables

Enable info schema tables collector

Default value

mariadb_exporter_collect_info_schema_tables: true

mariadb_exporter_cpu_shares

CPU shares with Docker deployment

Default value

mariadb_exporter_cpu_shares:

Example usage

mariadb_exporter_cpu_shares: '512'

mariadb_exporter_default_labels

List of default labels to assign to docker on OAuth2 Proxy

Default value

mariadb_exporter_default_labels: []

mariadb_exporter_default_publish

List of default port publishing for docker on OAuth2 Proxy

Default value

mariadb_exporter_default_publish: []

Example usage

mariadb_exporter_default_publish:
  - 127.0.0.1:9104:9104

mariadb_exporter_download

URL to the archive of the release to install

Default value

mariadb_exporter_download: https://github.com/prometheus/mysqld_exporter/releases/download/v{{
  mariadb_exporter_version }}/mysqld_exporter-{{ mariadb_exporter_version }}.linux-amd64.tar.gz

mariadb_exporter_enabled

Enable the mariadb exporter

Default value

mariadb_exporter_enabled: true

mariadb_exporter_extra_labels

List of extra labels to assign to docker on OAuth2 Proxy

Default value

mariadb_exporter_extra_labels: []

mariadb_exporter_extra_publish

List of extra port publishing for docker on OAuth2 Proxy

Default value

mariadb_exporter_extra_publish: []

Example usage

mariadb_exporter_extra_publish:
  - 127.0.0.1:9104:9104

mariadb_exporter_image

Docker image to use for deployment on OAuth2 Proxy

Default value

mariadb_exporter_image: prom/mysqld-exporter:v{{ mariadb_exporter_version }}

mariadb_exporter_memory_limit

Memory limit with Docker deployment

Default value

mariadb_exporter_memory_limit:

Example usage

mariadb_exporter_memory_limit: 1024m

mariadb_exporter_memory_soft_limit

Soft memory limit with Docker deployment

Default value

mariadb_exporter_memory_soft_limit:

Example usage

mariadb_exporter_memory_soft_limit: 512m

mariadb_exporter_memory_swap

Swap usage with Docker deployment

Default value

mariadb_exporter_memory_swap:

Example usage

mariadb_exporter_memory_swap: 2048m

mariadb_exporter_network

Optional docker network to attach on OAuth2 Proxy

Default value

mariadb_exporter_network: '{{ mariadb_network }}'

mariadb_exporter_number_of_cpus

Number of CPUs with Docker deployment

Default value

mariadb_exporter_number_of_cpus:

Example usage

mariadb_exporter_number_of_cpus: '1.5'

mariadb_exporter_pull_image

Pull image as part of the tasks

Default value

mariadb_exporter_pull_image: true

mariadb_exporter_version

Version of the release to install

Default value

mariadb_exporter_version: 0.15.1

mariadb_extra_configs

Write additional config files

Default value

mariadb_extra_configs: []

Example usage

mariadb_extra_configs:
  - name: example
    priority: 50
    content: |
      foo1 = bar1
      foo2 = bar2
      foo3 = bar3
  - name: foobar
    state: absent

mariadb_extra_databases

List of additional databases to create for native installation

Default value

mariadb_extra_databases: []

Example usage

mariadb_extra_databases:
  - name: example
    collation: utf8mb4_general_ci
    encoding: utf8mb4
    state: present
  - name: foobar
    state: absent

mariadb_extra_folders

List of extra folders to create

Default value

mariadb_extra_folders: []

Example usage

mariadb_extra_folders:
  - /path/to/host/folder1
  - /path/to/host/folder2
  - /path/to/host/folder3

mariadb_extra_labels

List of extra labels to assign to docker

Default value

mariadb_extra_labels: []

mariadb_extra_publish

List of extra port publishing for docker

Default value

mariadb_extra_publish: []

Example usage

mariadb_extra_publish:
  - 127.0.0.1:3306:3306

mariadb_extra_users

List of additional users to create for native installation

Default value

mariadb_extra_users: []

Example usage

mariadb_extra_users:
  - name: example
    password: p433w0rd
    host: '%'
    priv: '*.*:ALL'
    state: present
  - name: foobar
    state: absent

mariadb_extra_volumes

List of extra volumes to mount for docker

Default value

mariadb_extra_volumes: []

Example usage

mariadb_extra_volumes:
  - /path/to/host/folder1:/path/within/container1
  - /path/to/host/folder2:/path/within/container2
  - /path/to/host/folder3:/path/within/container3

mariadb_galera_address

Node address within galera cluster

Default value

mariadb_galera_address: '{{ ansible_address }}'

mariadb_galera_cluster

Default value

mariadb_galera_cluster: galera

mariadb_galera_enabled

Enable galera clustering

Default value

mariadb_galera_enabled: false

mariadb_galera_name

Node name within galera cluster

Default value

mariadb_galera_name: '{{ inventory_hostname }}'

mariadb_galera_nodes

Node addresses part of galera cluster

Default value

mariadb_galera_nodes: []

mariadb_galera_primary

Inventory of primary galera node

Default value

mariadb_galera_primary:

mariadb_global_databases

List of databases to create for native installation

Default value

mariadb_global_databases: []

Example usage

mariadb_global_databases:
  - name: example
    collation: utf8mb4_general_ci
    encoding: utf8mb4
    state: present
  - name: foobar
    state: absent

mariadb_global_users

List of users to create for native installation

Default value

mariadb_global_users: []

Example usage

mariadb_global_users:
  - name: example
    password: p433w0rd
    host: '%'
    priv: '*.*:ALL'
    state: present
  - name: foobar
    state: absent

mariadb_ignore_db_dirs

List of ignored database directories

Default value

mariadb_ignore_db_dirs: []

mariadb_image

Docker image to use for deployment

Default value

mariadb_image: mariadb:{{ mariadb_upstream_version }}

mariadb_innodb_buffer_pool_instances

InnoDB buffer pool instances

Default value

mariadb_innodb_buffer_pool_instances: 1

mariadb_innodb_buffer_pool_size

InnoDB buffer pool size

Default value

mariadb_innodb_buffer_pool_size: 256M

mariadb_innodb_file_per_table

InnoDB file per table

Default value

mariadb_innodb_file_per_table: 1

mariadb_innodb_flush_log_at_trx_commit

InnoDB flush at trx commit

Default value

mariadb_innodb_flush_log_at_trx_commit: 1

mariadb_innodb_io_capacity

InnoDB IO capacity

Default value

mariadb_innodb_io_capacity: 1000

mariadb_innodb_max_dirty_pages_pct

InnoDB max dirty pages percentage

Default value

mariadb_innodb_max_dirty_pages_pct: 90

mariadb_installation

Select installation method, could be native or docker

Default value

mariadb_installation: native

mariadb_key_buffer_size

Key buffer size

Default value

mariadb_key_buffer_size: 32M

mariadb_keyring

Path for the repository keyring

Default value

mariadb_keyring: /usr/share/keyrings/mariadb-archive-keyring.gpg

mariadb_limit_number_files

Number of allowed open files for systemd service

Default value

mariadb_limit_number_files: 32768

mariadb_lower_case_table_names

Lowercase table names

Default value

mariadb_lower_case_table_names: 0

mariadb_max_allowed_packet

Max allowed packet

Default value

mariadb_max_allowed_packet: 64M

mariadb_max_connections

Max allowed connections

Default value

mariadb_max_connections: 1000

mariadb_memory_limit

Memory limit with Docker deployment

Default value

mariadb_memory_limit:

Example usage

mariadb_memory_limit: 1024m

mariadb_memory_soft_limit

Soft memory limit with Docker deployment

Default value

mariadb_memory_soft_limit:

Example usage

mariadb_memory_soft_limit: 512m

mariadb_memory_swap

Swap usage with Docker deployment

Default value

mariadb_memory_swap:

Example usage

mariadb_memory_swap: 2048m

mariadb_network

Optional docker network to attach

Default value

mariadb_network:

mariadb_number_of_cpus

Number of CPUs with Docker deployment

Default value

mariadb_number_of_cpus:

Example usage

mariadb_number_of_cpus: '1.0'

mariadb_oom_score_adjust

Adjustment score for OOM killer

Default value

mariadb_oom_score_adjust: -999

mariadb_packages

List of packages to install

Default value

mariadb_packages:
  - mariadb-server
  - mariadb-client
  - mariadb-backup
  - mycli
  - python3-pymysql
  - rsync

mariadb_password

Password used within docker deployment

Default value

mariadb_password:

mariadb_pull_image

Pull image as part of the tasks

Default value

mariadb_pull_image: true

mariadb_query_cache_size

Query cache size

Default value

mariadb_query_cache_size: 0

mariadb_query_cache_type

Query cache type

Default value

mariadb_query_cache_type: 0

mariadb_root_hosts

Allowed hosts for root user

Default value

mariadb_root_hosts:
  - localhost
  - 127.0.0.1

mariadb_root_password

Password for the root user

Default value

mariadb_root_password: root

mariadb_root_username

Username for the root user

Default value

mariadb_root_username: root

mariadb_skip_name_resolve

Skip name resolving

Default value

mariadb_skip_name_resolve: true

mariadb_symbolic_links

Symbolic links

Default value

mariadb_symbolic_links: 0

mariadb_temp_directory

Temporary directory used by MariaDB

Default value

mariadb_temp_directory:

mariadb_timeout_start_sec

Time to wait for daemon startup

Default value

mariadb_timeout_start_sec: 120

mariadb_upstream_arch

Upstream repo architecture

Default value

mariadb_upstream_arch: "{{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64'
  }}"

mariadb_upstream_mirror

Upstream repo mirror URL

Default value

mariadb_upstream_mirror: http://mirror.23m.com/mariadb/repo

mariadb_upstream_repo

Install from upstream repository

Default value

mariadb_upstream_repo: true

mariadb_upstream_version

Upstream repo version

Default value

mariadb_upstream_version: 11.1

mariadb_username

Username used within docker deployment

Default value

mariadb_username:

Discovered Tags

mariadb

mariadb-exporter

Dependencies

License

Apache-2.0

Author

Thomas Boerger

Packages

No packages published

Languages

  • Jinja 56.0%
  • Nix 22.7%
  • Shell 19.2%
  • Python 2.1%