Add mariadb flavor

This commit is contained in:
Gregory Colpart 2016-12-15 23:02:56 +01:00 committed by Jérémy Lecour
parent b485b0b49c
commit a733f8a369
3 changed files with 17 additions and 3 deletions

View file

@ -18,6 +18,7 @@ Tasks are extracted in several files, included in `tasks/main.yml` :
## Available variables
* `mysql_use_mariadb` : use mariadb-server-10.0 instead of mysql-server ;
* `mysql_replace_root_with_mysqladmin`: switch from `root` to `mysqladmin` user or not ;
* `mysql_thread_cache_size`: number of threads for the cache ;
* `mysql_innodb_buffer_pool_size`: amount of RAM dedicated to InnoDB ;

View file

@ -1,3 +1,5 @@
mysql_use_mariadb: False
mysql_replace_root_with_mysqladmin: true
mysql_custom_datadir: ''
@ -6,7 +8,6 @@ mysql_custom_tmpdir: ''
mysql_thread_cache_size: '{{ ansible_processor_cores }}'
mysql_innodb_buffer_pool_size: '{{ (ansible_memtotal_mb * 0.3) | int }}M'
default_alert_mail: root
general_alert_mail: Null
log2mail_alert_mail: Null

View file

@ -1,11 +1,23 @@
---
- name: Ensure MySQL packages are installed
- name: Ensure MySQL (Oracle version) packages are installed
apt:
name: mysql-server
name: '{{ item }}'
state: installed
with_items:
- mysql-server
when: mysql_use_mariadb == False
tags:
- mysql
- packages
- name: Ensure MySQL (MariaDB version) packages are installed
apt:
name: '{{ item }}'
state: installed
with_items:
- mariadb-server-10.0
when: mysql_use_mariadb
tags:
- mysql
- packages