rchouinard.mysql-community

Ansible Role: MySQL Community Server

This role installs the MySQL Community Server on RHEL/CentOS, Fedora, Debian, and Ubuntu systems.

Requirements

If your system has SELinux enabled, you might need the libselinux-python package. This is necessary for the Ansible template module that creates the default MySQL configuration file.

For Fedora systems using DNF, you need to install the python2-dnf package.

Role Variables

Here are the variables you can set, along with their default values (check defaults/main.yml for more details):

  • mysql_root_pass: r@nd0mP4$5WORD
  • mysql_cfg_socket: (depends on your distribution)
  • mysql_cfg_pid_file: /var/run/mysqld/mysqld.pid
  • mysql_cfg_datadir: /var/lib/mysql
  • mysql_cfg_log_bin: /var/lib/mysql/mysql-bin
  • mysql_cfg_log_error: (depends on your distribution)
  • mysql_cfg_slow_query_log_file: (depends on your distribution)
  • mysql_cfg_cnffile: (depends on your distribution)
  • mysql_cfg_cnfdir: (depends on your distribution)
  • mysql_cfg_user: mysql
  • mysql_cfg_default_storage_engine: InnoDB
  • mysql_cfg_port: 3306
  • mysql_cfg_key_buffer_size: 32M
  • mysql_cfg_myisam_recover_options: FORCE, BACKUP
  • mysql_cfg_max_allowed_packet: 16M
  • mysql_cfg_max_connect_errors: 1,000,000
  • mysql_cfg_server_id: 999999
  • mysql_cfg_expire_logs_days: 14
  • mysql_cfg_sync_binlog: 1
  • mysql_cfg_tmp_table_size: 32M
  • mysql_cfg_max_heap_table_size: 32M
  • mysql_cfg_query_cache_type: 0
  • mysql_cfg_query_cache_size: 0
  • mysql_cfg_max_connections: 500
  • mysql_cfg_thread_cache_size: 50
  • mysql_cfg_open_files_limit: 65,535
  • mysql_cfg_table_definition_cache: 4,096
  • mysql_cfg_table_open_cache: 4,096
  • mysql_cfg_innodb_flush_method: O_DIRECT
  • mysql_cfg_innodb_log_files_in_group: 2
  • mysql_cfg_innodb_log_file_size: 200M
  • mysql_cfg_innodb_flush_log_at_trx_commit: 1
  • mysql_cfg_innodb_file_per_table: 1
  • mysql_cfg_innodb_buffer_pool_size: 1600M
  • mysql_cfg_log_queries_not_using_indexes: 1
  • mysql_cfg_slow_query_log: 1

Dependencies

Example Playbook

- hosts: database
  roles:
    - rchouinard.mysql-community
  vars:
    mysql_root_pass: "{{ lookup('password', 'credentials/mysqlpassword length=22') }}"

License

This role is licensed under MIT.

Author Information

This role was created in 2016 by Ryan Chouinard.

Informazioni sul progetto

MySQL Community Server

Installa
ansible-galaxy install rchouinard.mysql-community
Licenza
mit
Download
150
Proprietario
DevOps Engineer at Paymentus