项目作者: while-true-do

项目描述 :
An Ansible Role to install and configure mariadb.
高级语言: Python
项目地址: git://github.com/while-true-do/ansible-role-srv_mariadb.git
创建时间: 2019-06-06T17:54:51Z
项目社区:https://github.com/while-true-do/ansible-role-srv_mariadb

开源协议:BSD 3-Clause "New" or "Revised" License

下载


Github (tag)
Github (license)
Github (issues)
Github (pull requests)

Travis (com)

Ansible (min. version)
Ansible (platforms)
Ansible (tags)

Ansible Role: srv_mariadb

An Ansible Role to install and configure mariadb.

Motivation

mariadb is one of the most popular database servers.
Made by the original developers of MySQL.

Description

This role installs and configures mariadb.

  • install mariadb packages
  • configure mariadb
  • configure firewalld
  • perform mysql-secure-installation steps

Requirements

Used Modules:

Installation

Install from Ansible Galaxy

  1. ansible-galaxy install while_true_do.srv_mariadb

Install from Github

  1. git clone https://github.com/while-true-do/ansible-role-srv_mariadb.git while_true_do.srv_mariadb

Usage

Role Variables

  1. ---
  2. # defaults file for while_true_do.srv_mariadb
  3. # Define the source of installation
  4. # Currently only distribution packages are supported
  5. wtd_srv_mariadb_source: "distribution"
  6. ## Package Management
  7. wtd_srv_mariadb_package:
  8. - mariadb-server
  9. - python3-mysql
  10. # State can be present|latest|absent
  11. wtd_srv_mariadb_package_state: "present"
  12. ## Configuration Management
  13. wtd_srv_mariadb_conf_root_pass: ""
  14. wtd_srv_mariadb_conf_my_path: "/etc/my.cnf"
  15. wtd_srv_mariadb_conf_server_path: "/etc/my.cnf.d/mariadb-server.cnf"
  16. wtd_srv_mariadb_conf_server:
  17. port: "3306"
  18. bind_address: "127.0.0.1"
  19. character_set: "utf8mb4"
  20. symbolic_links: "0"
  21. data_dir: "/var/lib/mysql"
  22. socket: "/var/lib/mysql/mysql.sock"
  23. wtd_srv_mariadb_conf_innodb:
  24. file_per_table: "true"
  25. buffer_pool_size: "128M"
  26. wtd_srv_mariadb_conf_query_cache:
  27. type: "1"
  28. limit: "256K"
  29. min_res_unit: "2k"
  30. cache_size: "64M"
  31. ## Service Management
  32. wtd_srv_mariadb_service: "mariadb"
  33. # State can be started|stopped
  34. wtd_srv_mariadb_service_state: "started"
  35. wtd_srv_mariadb_service_enabled: true
  36. ## Firewalld Management
  37. wtd_srv_mariadb_fw_mgmt: true
  38. wtd_srv_mariadb_fw_service: "mysql"
  39. # State can be enabled|disabled
  40. wtd_srv_mariadb_fw_state: "enabled"
  41. # Zone can be according to defined zones on your machine.
  42. wtd_srv_mariadb_fw_zone: "public"
  43. ## Host Management
  44. wtd_srv_mariadb_reboot_enabled: true
  45. wtd_srv_mariadb_reboot_msg: "System is going down to ..."
  46. wtd_srv_mariadb_reboot_timeout: 3600

Example Playbook

Running Ansible
Roles
can be done in a
playbook.

Simple

  1. ---
  2. - hosts: all
  3. roles:
  4. - role: while_true_do.srv_mariadb
  5. wtd_srv_mariadb_conf_root_pass: "myPassword"

Allow network traffic

  1. - hosts: all
  2. roles:
  3. - role: while_true_do.srv_mariadb
  4. wtd_srv_mariadb_conf_root_pass: "myPassword"
  5. wtd_srv_mariadb_conf_server:
  6. port: "3306"
  7. bind_address: "0.0.0.0"

Known Issues

  1. RedHat Testing is currently not possible in public, due to limitations
    in subscriptions.
  2. Some services and features cannot be tested properly, due to limitations
    in docker.

Testing

Most of the “generic” tests are located in the
Test Library.

Ansible specific testing is done with
Molecule.

Infrastructure testing is done with
testinfra.

Automated testing is done with Travis CI.

Contribute

Thank you so much for considering to contribute. We are very happy, when somebody
is joining the hard work. Please fell free to open
Bugs, Feature Requests
or Pull Requests after
reading the Contribution Guideline.

See who has contributed already in the kudos.txt.

License

This work is licensed under a BSD-3-Clause License.

Contact