buluma.mysql

Ansible Role mysql

This role installs and sets up MySQL on your computer.

GitHub Version Issues Pull Requests Downloads
github Version Issues PullRequests Ansible Role

Example Playbook

Here's a simple example taken from molecule/default/converge.yml that is tested with every change.

---
- name: Converge
  hosts: all
  become: true
  gather_facts: true

  roles:
    - role: buluma.mysql
      mysql_port: 3307
      mysql_databases:
        - name: my_db
          encoding: utf8
          collation: utf8_bin
      mysql_users:
        - name: my_user
          password: my_pass
          priv: "my_db.*:ALL"
          update_password: on_create

Before running the above, prepare the machine using molecule/default/prepare.yml:

---
- name: Prepare
  hosts: all
  become: true
  gather_facts: false

  roles:
    - role: buluma.bootstrap

For a detailed explanation and examples, check the full guide on using these roles.

Role Variables

Default variable values are in defaults/main.yml:

---
# defaults file for mysql

# Where mysql should connect.
mysql_bind_address: "127.0.0.1"

# Port number to listen on.
mysql_port: 3306

# Root user password, also in my.cnf
mysql_root_password: "s3Cur31t4."

# Buffer pool size.
mysql_innodb_buffer_pool_size: 1G

# IO capacity.
mysql_innodb_io_capacity: 4000

# MySQL options can be specified here.
mysql_configuration_options:
  - option: bind-address
    section: mysqld
    value: "{{ mysql_bind_address }}"
  - option: port
    section: mysqld
    value: "{{ mysql_port }}"
  - option: socket
    section: mysqld
    value: "{{ mysql_socket }}"
  - section: mysqld
    option: innodb_buffer_pool_size
    value: "{{ mysql_innodb_buffer_pool_size }}"
  - section: mysqld
    option: innodb_io_capacity
    value: "{{ mysql_innodb_io_capacity }}"
  - section: mysqld
    option: log-bin-trust-function-creators
    value: "1"

Requirements

You need the pip packages listed in requirements.txt.

State of Used Roles

These roles help prepare your system. You can choose another way to prepare it.

Requirement GitHub Version
buluma.bootstrap Ansible Molecule Version

Context

This role is part of several compatible roles. Check the documentation for more information.

Related roles overview:

dependencies

Compatibility

This role works well with these container images:

Container Tags
Debian bullseye
EL 8, 9
Fedora all
opensuse all
Ubuntu all

Ansible version 2.12 or higher is required. Tests have been completed on:

  • The previous version.
  • The current version.
  • The development version.

If you encounter any issues, please report them on GitHub.

Changelog

See the Role History for changes.

License

This project is licensed under Apache-2.0.

Author Information

Created by Shadow Walker.

Informazioni sul progetto

Install and configure mysql on your system.

Installa
ansible-galaxy install buluma.mysql
Licenza
apache-2.0
Download
330k
Proprietario
DevOps Engineer