Add some new customisable configuration parameters

This commit is contained in:
Tristan PILAT 2018-08-23 09:30:53 +02:00
parent e939198159
commit 01ae7b0e31
3 changed files with 27 additions and 2 deletions

View file

@ -20,9 +20,17 @@ Tasks are extracted in several files, included in `tasks/main.yml` :
* `mysql_variant` : install Oracle's MySQL or MariaDB (default: `oracle`) [Debian 8 only];
* `mysql_replace_root_with_mysqladmin`: switch from `root` to `mysqladmin` user or not ;
* `mysql_bind_address` : (default: `127.0.0.1`) ;
* `mysql_thread_cache_size`: number of threads for the cache ;
* `mysql_innodb_buffer_pool_size`: amount of RAM dedicated to InnoDB ;
* `mysql_custom_datadir`: custom datadir
* `mysql_max_connections`: maximum number of simultaneous connections (default: `250`) ;
* `mysql_max_connect_errors`: number of permitted successive interrupted connection requests before a host gets blocked (default: `10`) ;
* `mysql_table_cache`: (default: `64`) ;
* `mysql_tmp_table_size`: (default: `128M`) ;
* `mysql_max_heap_table_size`: (default: `128M`) ;
* `mysql_query_cache_limit`: (default: `8M`) ;
* `mysql_query_cache_size`: (default: `256M`) ;
* `mysql_custom_datadir`: custom datadir.
* `mysql_custom_tmpdir`: custom tmpdir.
* `general_alert_email`: email address to send various alert messages (default: `root@localhost`).
* `log2mail_alert_email`: email address to send Log2mail messages to (default: `general_alert_email`).

View file

@ -14,8 +14,17 @@ mysql_replace_root_with_mysqladmin: True
mysql_custom_datadir: ''
mysql_custom_tmpdir: ''
mysql_bind_address: '127.0.0.1'
mysql_thread_cache_size: '{{ ansible_processor_cores }}'
mysql_innodb_buffer_pool_size: '{{ (ansible_memtotal_mb * 0.3) | int }}M'
mysql_max_connections: '250'
mysql_max_connect_errors: '10'
mysql_table_cache: '64'
mysql_tmp_table_size: '128M'
mysql_max_heap_table_size: '128M'
mysql_query_cache_limit: '8M'
mysql_query_cache_size: '256M'
mysql_cron_optimize: True
mysql_cron_optimize_frequency: weekly

View file

@ -1,4 +1,12 @@
[mysqld]
#bind-address = 0.0.0.0
bind-address = {{ mysql_bind_address }}
thread_cache_size = {{ mysql_thread_cache_size }}
innodb_buffer_pool_size = {{ mysql_innodb_buffer_pool_size }}
max_connections = {{ mysql_max_connections }}
max_connect_errors = {{ mysql_max_connect_errors }}
table_cache = {{ mysql_table_cache }}
tmp_table_size = {{ mysql_tmp_table_size }}
max_heap_table_size = {{ mysql_max_heap_table_size }}
query_cache_limit = {{ mysql_query_cache_limit }}
query_cache_size = {{ mysql_query_cache_size }}