mkubenka.mysql

Ansible Role MySQL

MySQL is a free and open-source database system. This role uses the MySQL Community Yum repository.

Inspired by https://github.com/mjanser/ansible-role-mysql

Requirements

No special requirements.

Role Variables

Here are the variables you can set when using this role. For more details, check the defaults/main.yml file.


# Supported versions: 5.5, 5.6, 5.7, and 8.0
mysql_version: '5.7'

# This value is required.
mysql_root_password: ''

mysql_import_timezones: true

mysql_bind_address: 127.0.0.1

# You can use https://tools.percona.com/wizard to help.
mysql_server_options:
  ## Memory settings
  'table_open_cache': '64'
  'key_buffer_size': '16M'
  'innodb_buffer_pool_size': '16M'
  'thread_cache_size': '8'
  'ft_min_word_len': '3'

  'innodb_log_file_size': '5M'
  'innodb_log_buffer_size': '8M'
  'innodb_flush_log_at_trx_commit': '1'
  'innodb_lock_wait_timeout': '50'

  ## Connection limits
  'max_connections': '100'
  'max_connect_errors': '100'
  'long_query_time': '5'
  'max_tmp_tables': '40'
  'wait_timeout': '100'
  'interactive_timeout': '900'
  'connect_timeout': '4'
  'max_allowed_packet': '2MB'

  ## Query cache settings
  'query_cache_limit': '2M'
  'query_cache_size': '32M'
  'query_prealloc_size': '10M'

# Define extra MySQL users.
mysql_users:
  - name: datadog
    password: "CorrectHorseBatteryStaple1$"
    privileges: "*.*:REPLICATION CLIENT,PROCESS/performance_schema.*:SELECT"

# Password for the replication user
mysql_slave_password: ''

# List of hosts allowed to connect as the replication user
mysql_slaves_hosts: 
  - 10.10.0.2
  - db2

Dependencies

No dependencies.

Example Playbook

Here's a sample playbook:

- hosts: servers
  roles:
     - { role: mkubenka.mysql, mysql_root_password: 'CorrectHorseBatteryStaple1$' }

License

BSD

Author Information

Michal Kubenka mkubenka@gmail.com

Informazioni sul progetto

MySQL Role.

Installa
ansible-galaxy install mkubenka.mysql
Licenza
Unknown
Download
1.7k
Proprietario